When creating an Azure Function triggered via HTTP, one way to authorize use of the function is to configure the HTTP function trigger to require the caller to provide a function key.
![Azure Function HTTP Trigger Authorization Modes Azure Function HTTP Trigger Authorization Modes](/blog/image.axd?picture=image_24.png)
With the authorization set to Anonymous, as expected anyone can call it.
When set to Function Authorization, the caller needs to provide the function key either as a URL query string parameter or in a header.
The function key can be found by navigating to Manage tab as the following screenshot shows:
![Finding the Azure Function Key Finding the Azure Function Key](/blog/image.axd?picture=image_25.png)
Once Function Authorization is enabled, if the client does not provide it correctly the function will return a 401 Unauthorized.
To supply the function key in the URL, the “code” query string parameter can be used, e.g. “https://myazurecloudfunctions.azurewebsites.net/api/SayHi?code=udXhf3pviSICFMtViW/pqmV/1Q5vLH5aMcRWXfD/q6NXk2VVxRlfYw==”.
Alternatively an “x-functions-key” header can be added containing the key as the following Postman screenshot shows:
![Calling Azure Function with Postman and Function Key Calling Azure Function with Postman and Function Key](/blog/image.axd?picture=image_26.png)
To jump-start your Azure Functions knowledge check out my Azure Function Triggers Quick Start Pluralsight course.
You can start watching with a Pluralsight free trial.
![](//a.impactradius-go.com/display-ad/7490-1161404)
![](https://pluralsight.pxf.io/i/1392775/1161404/7490)
SHARE: