Question

Difficulty: MediumImplement Durable Functions

You are designing a long-running batch data processing workflow using Azure Durable Functions in C# (.NET Isolated). The workflow must retrieve a list of database servers, execute a schema migration process on each database in parallel, wait for all migrations to complete, and then send a status update. The schema migration on each database can take up to 45 minutes, and the total execution of the workflow can take several hours.

You need to select the hosting plan and implement the execution pattern.

Which of the following actions should you perform? (Select two.)

  1. Deploy the Azure Functions to a Premium plan or a Dedicated App Service plan.Answer
  2. Call the migration activity functions inside a loop to populate a list of tasks, and then await them using Task.WhenAll.Answer
  3. C
    Deploy the Azure Functions to a Consumption plan to minimize idling costs.
  4. D
    Await the execution of each migration activity function sequentially inside the loop that iterates over the list of databases.

Answer

To meet the requirements, you must deploy the Azure Functions to a Premium plan or a Dedicated App Service plan to avoid the 10-minute execution duration limit of the Consumption plan. Additionally, you should call the migration activity functions inside a loop to populate a list of tasks and then await them using Task.WhenAll to achieve parallel execution (Fan-out/Fan-in pattern).
Deploying to a Premium or Dedicated App Service plan ensures that the functions can execute beyond the 10-minute limit of the Consumption plan. Implementing the Fan-out/Fan-in pattern by populating a list of tasks and using Task.WhenAll ensures the activities execute concurrently in parallel.

Step-by-Step Solution

1
Analyze the execution duration requirement for individual tasks.
Identify that the migration process takes 45 minutes, which exceeds the maximum execution timeout of 10 minutes on the Consumption plan.
This determines that either a Premium plan or a Dedicated App Service plan is required to support long-running activities.
2
Analyze the concurrency requirement for processing the databases.
Identify that migrations must execute in parallel.
This determines that a Fan-out/Fan-in pattern must be used, which requires triggering activities asynchronously and awaiting them collectively.
3
Implement the parallel execution logic in the orchestrator code.
Add activity execution tasks to a collection within a loop, and then await them using Task.WhenAll.
This executes the activities concurrently and prevents sequential blocking.

Key Concept

Selecting hosting plans and implementing parallel execution patterns (Fan-out/Fan-in) in Azure Durable Functions.
Rate this question