You are developing a nightly data aggregation pipeline using Azure Durable Functions (.NET Isolated process). The orchestrator function is triggered daily to collect sales reports from multiple regional API endpoints, consolidate them, and write the summary to a database.
The orchestrator code is defined as follows:
csharp
[Function("AggregateDailySalesOrchestrator")]
public static async Task<SalesSummary> Run(
[OrchestrationTrigger] TaskOrchestrationContext context)
{
var regions = await context.CallActivityAsync<List<string>>("GetActiveRegions", null);
var tasks = new List<Task<RegionReport>>();
foreach (var region in regions)
{
tasks.Add(context.CallActivityAsync<RegionReport>("FetchRegionReport", region));
}
// Fan-out: wait for all parallel fetch operations to complete
var reports = await Task.WhenAll(tasks);
// Fan-in processing
var summary = new SalesSummary { RunId = Guid.NewGuid().ToString() };
foreach (var report in reports)
{
if (report.Timestamp >= DateTime.UtcNow.AddHours(-24))
{
summary.TotalRevenue += report.Revenue;
}
}
await context.CallActivityAsync("SaveSummaryToDatabase", summary);
return summary;
}
During testing under heavy loads, you observe that the `FetchRegionReport` activity function occasionally takes up to minutes to complete due to slow external APIs, resulting in execution failures. The Function App is currently deployed to an Azure Functions Consumption plan.
Which action must you take to ensure that the orchestration runs successfully, executes without timeouts, and produces deterministic results?
- AKeep the Function App on the Consumption plan since Durable orchestrators automatically split and checkpoint tasks to bypass the -minute limit; in the orchestrator code, replace Guid.NewGuid() with context.NewGuid() and replace DateTime.UtcNow with context.CurrentUtcDateTime.
- BMigrate the Function App to a Premium plan to support the -minute activity execution duration; in the orchestrator code, keep Guid.NewGuid() and DateTime.UtcNow as they are because determinism constraints only apply to activity invocation calls.
- Migrate the Function App to a Premium plan to support the -minute activity execution duration; in the orchestrator code, replace Guid.NewGuid() with context.NewGuid() and replace DateTime.UtcNow with context.CurrentUtcDateTime.Cevap
- DMigrate the Function App to a Premium plan to support the -minute activity execution duration; in the orchestrator code, replace Guid.NewGuid() with context.NewGuid() but keep DateTime.UtcNow because the runtime automatically captures and replays DateTime values from the history log.