1
votes

Azure Function HttpTrigger default use code parameter with token code, e.g: https://xxx.azurewebsites.net/api/xxxHttpTriggerCSharp?code=)#&)@^$^@#)

How can I replace code name by token like:
https://xxx.azurewebsites.net/api/xxxHttpTriggerCSharp?token=)#&)@^$^@#)

The situation I met:
A service also uses the code parameter, which leads to conflicts in authentication.

2
I think it is no possible. If you have an authentication type like 'function', then you need to give the function key. 'code=' is by design, I think your requirement is impossible.1_1
What about creating a Proxy in azure functions and setup the actual Http Endpoint; the proxy change the token query parameter to code as needed by azure functions (or can be done by Http Request header too). Read hereuser1672994

2 Answers

1
votes

I think it is no possible. If you have an authentication type like 'function', then you need to give the function key. 'code=' is by design, I think your requirement is impossible.

If you don't want to use the authentication type, you can set the authentication type to anonymous(If you use script language, you can set it in the functin.json. If you use language that needs to be compiled, you can set it in the declaration part).

1
votes

You could send the code value as a header instead: x-functions-key

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

This would free up the code parameter for use.