Azure Functions · AZ-204: Developing Solutions for Microsoft Azure Develop Azure Compute Solutions
You are developing a C HTTP-triggered Azure Function named SubmitOrder. Only clients that possess a function key should be able to invoke it. Which i…
Practice question from Azure Functions (AZ-204: Developing Solutions for Microsoft Azure Develop Azure Compute Solutions), with the correct answer and a step-by-step solution.
medium · MCQ · Q-A8D19B
You are developing a C# HTTP-triggered Azure Function named SubmitOrder. Only clients that possess a function key should be able to invoke it. Which implementation and request behavior meet the requirement?
- A.Decorate the function with [HttpTrigger(AuthorizationLevel.Function, "post", Route = "orders")] and send the key in the x-functions-key request header.Correct answer
- B.Decorate the function with [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "orders")] and send the key in the Authorization bearer token.
- C.Decorate the function with [HttpTrigger(AuthorizationLevel.Admin, "post", Route = "orders")] and send the key in the request body.
- D.Decorate the function with [HttpTrigger(AuthorizationLevel.Function, "post", Route = "orders")] and place the key in the response body returned by the function.
Solution
AuthorizationLevel.Function requires a function-level or host-level key. Clients can provide the key using the x-functions-key header or the code query-string parameter. Anonymous access does not require a key, and the key is not supplied in the response or request body.
More from Azure Functions
- A company wants an Azure Function to run whenever a file is uploaded to the incoming container in Azure Blob Storage. The function must cre…
- A durable workflow receives a list of 100 document IDs. It must process all documents in parallel and then return only after every document…
- An Azure Function must run automatically every five minutes. Which timer trigger schedule expression uses the Azure Functions six-field NCR…
- A company is hosting an HTTP-triggered Azure Function that must scale automatically, support virtual network integration, and minimize cold…
Practise more Develop Azure Compute Solutions
Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.
Start practising freeFree to start · No credit card needed