Azure Functions - Can I use an HTTP request parameter called "code"

Joseph Jobbings 96 Reputation points

I want to use an Azure Function to serve as the redirect_uri for an oauth2/authorize request. The oauth2/authorize endpoint will redirect to our Azure function - following successful authentication - and supply an authorization code via a parameter called 'code'. In my Function under development, using the example code generated by the CLI func new ... the HTTP trigger code (typescript/ node js) responds fine to a request like,
but changing the request to
results in

This page isn’t working is currently unable to handle this request.

Tagging some helpful users in this forum: @dixitaro-MSFT @Jeff Hollan [MSFT]

My questions are

  1. is this behaviour a result of the code parameter being reserved for Azure API Authorization keys? i.e.
  2. if the answer to my question (1) is "yes the Function bombs out because the code= parameter value is not known to Azure" then is there a way i can configure my Azure Function to get around this - i.e so that the oauth2 request code parameter value is successfully delivered to my function code?
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,481 questions
0 comments No comments
{count} votes

Accepted answer
  1. Joseph Jobbings 96 Reputation points

    Thanks @Pramod Vasanth for you reply.
    Could you share how you confirmed that my use case should work? My Function is running in Azure Static Web Apps. My function.json already specifies, { "bindings": [ {"authLevel": "anonymous", ...}

    Since posting this question last week I've heard back from Microsoft, confirming this is an known issue see, there is no date for when this will be fixed but the github issue includes a workaround.

1 additional answer

Sort by: Most helpful
  1. Pramod Valavala 20,601 Reputation points Microsoft Employee

    If the Authentication Level is set to Anonymous, the code query parameter can be used as required in your case, which I can confirm works.

    0 comments No comments