Consider a Durable Function orchestration that calls an activity function which throws an exception. What is the default behavior of the orchestration?
Think about how Durable Functions handle errors and retries in activity functions.
By default, if an activity function fails, the orchestration fails unless a retry policy is set. With a retry policy, the orchestration retries the activity function automatically before failing.
You want to run several independent activity functions at the same time and proceed only after all have finished. Which Durable Functions orchestration pattern should you use?
Consider which pattern allows parallel execution and aggregation of results.
The fan-out/fan-in pattern runs multiple activity functions in parallel (fan-out) and waits for all to complete before continuing (fan-in).
You want your orchestration to pause and wait until it receives a specific external event named 'ApprovalReceived'. Which code snippet correctly implements this behavior?
public static async Task RunOrchestrator([OrchestrationTrigger] IDurableOrchestrationContext context) { // Wait for external event var approval = await context.WaitForExternalEvent<bool>("ApprovalReceived"); if (approval) { await context.CallActivityAsync("ProcessApproval", null); } else { await context.CallActivityAsync("RejectApproval", null); } }
Check the method signature and required parameters for waiting on external events.
The method WaitForExternalEvent requires the event name and the expected type. Option D correctly specifies both.
You need to send a secret API key to an activity function without exposing it in logs or storage. What is the best practice to handle this?
Think about secure storage and minimizing exposure of secrets.
Storing secrets in Azure Key Vault and retrieving them at runtime inside the activity function avoids exposing secrets in orchestration inputs or logs.
Durable Functions support a 'function chaining' pattern where one function calls another in sequence. What key benefit does this pattern provide over normal sequential calls in serverless environments?
Consider how Durable Functions manage state and reliability in workflows.
The function chaining pattern allows Durable Functions to save state and checkpoint after each function call, enabling reliable long-running workflows that can survive restarts.