Question

Difficulty: EasyImplement Durable Functions

You are developing a serverless workflow using Azure Durable Functions. You need to ensure that the orchestrator function remains deterministic during execution. Which two actions must you perform to meet this requirement?

  1. Use the context's current UTC date-time property instead of using standard system date-time calls.Answer
  2. Create durable timers using the orchestration context rather than using thread sleep or task delay methods.Answer
  3. C
    Generate unique request identifiers within the orchestrator using standard system GUID generation APIs.
  4. D
    Retrieve configuration settings directly from environment variables inside the orchestrator function.

Answer

To ensure the orchestrator function remains deterministic, you must use the context's current UTC date-time property instead of standard system date-time calls, and create durable timers using the orchestration context rather than thread sleep or task delay methods.
Orchestrator functions in Azure Durable Functions must be deterministic to ensure that replay execution behaves identically. Using the built-in context properties for current UTC date-time and creating durable timers instead of blocking threads ensures that the orchestration state remains consistent across execution replays.

Step-by-Step Solution

1
Identify the core constraints of Durable Functions orchestrator functions.
Orchestrator functions must be deterministic because they are replayed to rebuild state.
Replay execution requires that the same input always produces the exact same output, with no side effects.
2
Evaluate the options for system date-time, timers, and external variables.
Standard system calls like DateTime.UtcNow and Thread.Sleep or Task.Delay are non-deterministic or block execution, whereas context-provided properties (e.g., CurrentUtcDateTime) and durable timers are safe for replay.
The orchestrator context manages these operations to ensure consistent behavior across replays.

Key Concept

Orchestrator Function Determinism Constraints
Estimated Time:45s
Rate this question