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.)
- Deploy the Azure Functions to a Premium plan or a Dedicated App Service plan.Cevap
- Call the migration activity functions inside a loop to populate a list of tasks, and then await them using Task.WhenAll.Cevap
- CDeploy the Azure Functions to a Consumption plan to minimize idling costs.
- DAwait the execution of each migration activity function sequentially inside the loop that iterates over the list of databases.
Cevap
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.
Adım Adım Çözüm
Anahtar Kavram
Selecting hosting plans and implementing parallel execution patterns (Fan-out/Fan-in) in Azure Durable Functions.