Skip to content

Answer unsupported methods and media types in Azure Functions - #10488

Merged
glen-84 merged 2 commits into
mainfrom
gai/azure-functions-unsupported-requests
Oct 6, 2026
Merged

glen-84 merged 2 commits into
mainfrom
gai/azure-functions-unsupported-requests

Conversation

@glen-84

@glen-84 glen-84 commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Under the opt-in Draft20260903 transport version, the Azure Functions pipeline answers a request no GraphQL middleware takes the way MapGraphQL does: 405 with an Allow header for an unsupported method, 204 with Allow for OPTIONS, and 415 for a POST or QUERY with an unsupported Content-Type. It ends with the same HttpUnsupportedRequestMiddleware, scoped to the function route, so a request below the route still gets 404. Legacy and Draft20250508 answers do not change, and Draft20260903 is new in 16.7.
  • The graphql-azf template's HttpTrigger lists no methods, so every method reaches Hot Chocolate. The Functions host answers a method the trigger does not list with 404 itself (Azure/azure-functions-host#11625, Azure/azure-functions-dotnet-worker#2452), which the HTTP transport page now states.
  • The Azure Functions note in the 16.6 to 16.7 migration guide includes the 405 that a GET gets when GET requests are disabled under Draft20260903.

Test plan

  • InProcessEndToEndTests and IsolatedProcessEndToEndTests pin a PUT, an OPTIONS, a text/plain POST, a text/plain QUERY with QUERY requests enabled, and a GET with GET requests disabled under Legacy, Draft20250508, and Draft20260903, plus a PUT below the function route. The Draft20260903 rows fail without the middleware.
  • Both classes also execute a QUERY request with QUERY requests enabled, which fails without the QUERY middleware in the Azure Functions pipeline.
  • Both Azure Functions test projects pass on net8.0, net9.0, net10.0, and net11.0.

Copilot AI lite review requested due to automatic review settings October 6, 2026 12:32
@github-actions github-actions Bot added 📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate labels Oct 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Add Azure Functions integration coverage for enabled QUERY requests and unsupported content types.

Review effort: Lite
Findings: None

What changed in this PR

Updates Azure Functions to support Draft20260903 responses for unsupported methods and media types while preserving legacy behavior.

Changes:

  • Adds unsupported-request middleware.
  • Updates the Azure Functions template and documentation.
  • Adds in-process and isolated-process integration tests.
File Summary
website/​content/​docs/​hotchocolate/​server/​http-transport.md Documents Azure Functions routing behavior.
website/​content/​docs/​hotchocolate/​migrating/​migrate-from-16-6-to-16-7.md Updates migration guidance.
templates/​azure-function/​GraphQLFunction.cs Allows all methods to reach Hot Chocolate.
src/​HotChocolate/​AzureFunctions/​test/​HotChocolate.AzureFunctions.Tests/​InProcessEndToEndTests.cs Tests in-process transport responses.
src/​HotChocolate/​AzureFunctions/​test/​HotChocolate.AzureFunctions.IsolatedProcess.Tests/​IsolatedProcessEndToEndTests.cs Tests isolated-process transport responses.
src/​HotChocolate/​AzureFunctions/​src/​HotChocolate.AzureFunctions/​Extensions/​HotChocolateAzureFunctionServiceCollectionExtensions.cs Adds unsupported-request handling.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Patch coverage

100.0% of changed lines covered (4/4)

File Covered Changed Patch %
…/HotChocolateAzureFunctionServiceCollectionExtensions.cs 4 4 100.0% 🟢

Project coverage: 57.9% (301334/520261 lines)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved blocking issues were identified.

Review effort: Lite
Findings: None

@glen-84
glen-84 merged commit d62cb4a into main Oct 6, 2026
159 checks passed
@glen-84
glen-84 deleted the gai/azure-functions-unsupported-requests branch October 6, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📚 documentation This issue is about working on our documentation. 🌶️ hot chocolate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants