Azure Functions · AZ-204: Developing Solutions for Microsoft Azure Develop Azure Compute Solutions
A durable workflow receives a list of 100 document IDs. It must process all documents in parallel and then return only after every document has compl…
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.
hard · MCQ · Q-334587
A durable workflow receives a list of 100 document IDs. It must process all documents in parallel and then return only after every document has completed. The workflow must also remain correct when the orchestrator replays its history. Which implementation is appropriate for the orchestration function?
- A.Call an activity for each document, store the returned tasks, and await Task.WhenAll(tasks). Put all document-processing logic inside the activities.Correct answer
- B.Process each document with a direct database call from the orchestrator and use DateTime.UtcNow to record the start time.
- C.Start a new Task.Run operation for each document from the orchestrator and return immediately after starting the tasks.
- D.Call one activity for each document sequentially, await each activity before starting the next, and perform the database calls directly in the orchestrator.
Solution
Durable orchestrators should schedule work through activity functions and use Task.WhenAll for fan-out/fan-in. Activities perform external I/O and side effects. Orchestrator code must be deterministic because it can replay; direct I/O, DateTime.UtcNow, and unmanaged tasks can produce incorrect replay behavior.
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…
- You are developing a C HTTP-triggered Azure Function named SubmitOrder. Only clients that possess a function key should be able to invoke i…
- 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