Authenticate Azure Functions

1.9k views Asked by At

I am using a HTTP Function App, I would like to authenticate it using client id and function keys (inside my function) using python.

I have a API Management setup for the current service but would like to authenticate on function app level.

Thanks

1

There are 1 answers

0
SwethaKandikonda On

For this one of the workaround is that you can set its Authorization level to Function.

enter image description here

Note: Make sure you are providing function key as a URL query string parameter in code property (i.e., https://< Your Function App>.azurewebsites.net/api/< Your Function Name>?code=< Your Function Key>). Alternatively, If you are calling function from postman you can just add x-functions-key header and set function key to it.

You can find all the function keys from Trigger >> Function Keys

enter image description here

but from the Official Documention you can see that it is not a good practice to distribute shared secret in public apps.

If your function is being called from a public client, you may want to consider implementing another security mechanism

Alternatively, you can use AAD to authenticate your Function App (i.e., Through App registration). For more information, you can refer Azure Function authentication using Azure Active Directory