Wei Lin
Wei Lin

Reputation: 3811

How azure function HttpTrigger edit code parameter name?

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.

Upvotes: 2

Views: 957

Answers (2)

Chris
Chris

Reputation: 3293

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

https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook-trigger?tabs=python-v2%2Cin-process%2Cfunctionsv2&pivots=programming-language-csharp#api-key-authorization

This would free up the code parameter for use.

Upvotes: 3

suziki
suziki

Reputation: 14088

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).

Upvotes: 1

Related Questions