You are developing a web API using Azure Functions. The API contains two HTTP-triggered functions: a function named GetProducts that retrieves public product catalog data, and a function named UpdateInventory that performs administrative inventory modifications. You must deploy these functions to a single Azure Function App. The security requirements are as follows: clients must be able to call GetProducts without providing any credentials or API keys; clients calling UpdateInventory must provide an API key, but you must minimize permissions and avoid using the master host key. Which configuration should you apply to the HTTP triggers to meet these requirements?
- Set the authorization level of GetProducts to Anonymous, and set the authorization level of UpdateInventory to Function.Answer
- BSet the authorization level of GetProducts to Anonymous, and set the authorization level of UpdateInventory to Admin.
- CSet the authorization level of GetProducts to Function, and set the authorization level of UpdateInventory to Function.
- DSet the authorization level of GetProducts to Anonymous, and set the authorization level of UpdateInventory to Anonymous.
Answer
Configure the HTTP trigger authorization level for the GetProducts function to Anonymous and the UpdateInventory function to Function.
The correct configuration sets the authorization level of the public function to Anonymous (allowing access without any key validation) and sets the administrative function to Function (requiring a function-specific API key, which restricts access and avoids exposing the broader master host key).
Step-by-Step Solution
Key Concept
HTTP Trigger Authorization Levels in Azure Functions
Estimated Time:1m 30s