azure-functions-host: Azure Functions does not work if length of the request URL (with query-params) is > 2102
I use proxies for a SPA, and to handle OAuth2 authorization code grant flow. When my function app receives a redirect with the code
, state
, and id_token
query params, I was noticing that the function wouldn’t even execute. There is no error in the logs either. So I tested by truncating the value of the query params and it turns out that if the length exceeds 2102, then the routing doesn’t work for some reason.
Investigative information
Note: I have provided information of a normal execution of my function. When the problem occurs, there is actually nothing in the logs that would indicate this problem. Furthermore, Proxy-Trace-Enabled
header attribute doesn’t help either because no function has executed.
- Timestamp: 2018-01-19T05:42:29.349
- Function App version (1.0 or 2.0-beta): 1.0
- Function App name:
- Function name(s) (as appropriate): after-auth
- Invocation ID: a3df31ab-6fff-4517-b836-7170e245d1bd
- Region: West US
Repro steps
- Create a proxy rule that invokes a function.
- Call the function app so that the proxy rule is executed but with query-params with length > 2102.
Expected behavior
After step 2, the proxy rule would be invoked and the function should execute.
Actual behavior
- Browser receives a 404 Not Found HTTP status code.
- Proxy rule won’t be executed but instead you will get a response
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Known workarounds
Use the request body instead of query-params.
Related information
- JS function
- HttpBinding
EDIT: I wanted to clarify that the length I am talking about is the total length of the URL with the query params, and not just the length of the query params put together. EDIT2: Updated the notes under Actual Behavior.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 24 (11 by maintainers)
Commits related to this issue
- Update max querystring per https://github.com/Azure/azure-webjobs-sdk-script/issues/2331 and to be in sync with nginx — committed to Azure/azure-functions-host by safihamid 6 years ago
- https://github.com/Azure/azure-webjobs-sdk-script/issues/2331 — committed to Azure/azure-functions-host by safihamid 6 years ago
@praneetloke I tested this again on a new function app and it’s working for me. can you please send me your function app name, proxies.json and the url your are using? you can email me directly at hamids at microsoft dot com
Yes it will land in v1.0
OK I sent a PR to increase the querystring max length to 4096.