azure-functionsazure-aksazure-functions-runtimeazure-functions-docker

Azure Function running in AKS throws 500 on query string parameter for http trigger function


I have an azure function app that I have containerized and running in AKS. One of my http endpoints has a query string parameter of code=. When I call that endpoint I immediately get a 500 response. To rule out anything in the code I only return a 400 just to validate that I am executing the code. The strange thing is that if I change the query string parameter to anything other that code, for example codeg, I get back the proper 400 response.

I've enabled debug logging and I am getting a route match so I know the call is getting to the function app. However I am getting no other logs to indicate what might be failing.


Solution

  • It may be throwing an error because it's expecting the function key to be in the code query parameter.

    I'm assuming you have a function key securing the endpoint?

    Try sending the function key in the header x-functions-key which should free up the code query parameter for your use.

    https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook-trigger?tabs=csharp#api-key-authorization