Soru

Zorluk: Çok zorImplement Durable Functions

You are designing a financial reconciliation pipeline using Azure Durable Functions in C#. The workflow is triggered hourly to audit transactions. A critical activity function in the pipeline performs a complex ledger analysis that takes up to 25 minutes to execute. Additionally, the orchestrator function must generate a unique tracking identifier for each transaction and write a custom log entry to Azure Application Insights at the start of each execution.

You need to select the appropriate hosting plan and ensure the orchestrator function complies with the Durable Functions execution constraints.

Which two actions should you perform? (Select two.)

  1. Deploy the function app to an Azure Functions Premium plan.Cevap
  2. Generate the tracking identifier in the orchestrator function by calling context.NewGuid().Cevap
  3. C
    Deploy the function app to an Azure Functions Consumption plan to maximize cost efficiency.
  4. D
    Write the custom log entry directly using the standard ILogger instance passed to the orchestrator.
  5. E
    Generate the tracking identifier by calling System.Guid.NewGuid() directly in the orchestrator function.

Cevap

Deploy the function app to an Azure Functions Premium plan, and generate the tracking identifier in the orchestrator function by calling context.NewGuid().
Deploying to the Premium plan allows the activity function to execute beyond the 10-minute limitation of the Consumption plan, supporting execution durations up to 30 minutes (or unbounded depending on configuration). Generating the tracking identifier with context.NewGuid() ensures that the ID remains stable during orchestrator replays, satisfying the requirement for orchestrator determinism.

Adım Adım Çözüm

1
Determine the hosting plan based on execution limits.
Identify that the Premium plan or Dedicated plan is required because the ledger analysis activity function takes 25 minutes, exceeding the Consumption plan's 10-minute limit.
The Consumption plan enforces a strict maximum execution timeout of 10 minutes per invocation.
2
Evaluate the requirement for unique tracking identifiers inside the orchestrator function.
Select context.NewGuid() over System.Guid.NewGuid() to maintain determinism.
Orchestrator functions must be deterministic, meaning they must produce the same outputs given the same inputs. Standard GUID generation is non-deterministic and violates replay safety.
3
Evaluate the logging options.
Reject the standard ILogger call because it writes duplicate logs during replays.
Standard logging causes duplicate telemetry on replays. Instead, context.CreateReplaySafeLogger(logger) must be used to filter out log statements during replays.

Anahtar Kavram

Orchestrator determinism and hosting plan limitations in Azure Durable Functions
Bu soruyu puanla