AZ-204 Develop Azure compute solutions Practice Question
You develop an Azure Function app that processes orders. The function must write order status updates to a database. You need to ensure that if the function fails after writing to the database, the order is not lost and can be retried. Which pattern should you implement?
⚠ Common exam trap
Watch out — candidates often confuse a simple retry policy (Option B) with the durable checkpointing and replay mechanism, not realizing that a retry policy alone cannot prevent duplicate writes or recover from failures that occur after a side effect has been committed.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use a Durable Functions orchestration
Durable Functions orchestrations provide built-in support for reliable execution and automatic retry on failure. By using an orchestration, you can write the order status to the database as an activity function, and if the function fails after the write, the orchestration can replay from the last checkpoint, ensuring the order is not lost and can be retried without duplicating the write.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Use a Durable Functions orchestration
Why this is correct
Durable Functions orchestrations are specifically designed for stateful workflows, allowing you to define a reliable sequence of operations that can span multiple function invocations and external system interactions. The orchestrator function maintains its state, automatically retries failed activity functions, and can implement complex compensation logic to ensure the entire order processing workflow completes atomically or achieves eventual consistency, even across failures and reboots. This provides robust error handling and guarantees the overall process state.
- ✗
Use a retry policy in the function code
Why it's wrong here
While a retry policy within the function code can re-attempt a failed operation, it only retries the current function invocation from the beginning. If the function partially succeeds, such as by writing data to a database, and then fails before completing, a simple retry will re-execute the entire function, potentially leading to duplicate database writes or an inconsistent state without explicit, complex custom idempotency or compensation logic. It does not provide transactional guarantees across multiple steps or external systems.
- ✗
Enable function-level exception handling
Why it's wrong here
Enabling function-level exception handling using `try-catch` blocks is essential for managing errors gracefully within a single function's execution. However, it is a localized error management mechanism that only addresses issues within that specific invocation. It does not provide any built-in capabilities for persisting state across function calls, automatically retrying an entire multi-step workflow from a known good point, or implementing compensation logic for external side effects that occurred before the exception was caught.
- ✗
Use an Azure Storage Queue for the function input
Why it's wrong here
A queue input ensures the message is not lost, but if the function fails after writing to the database, the message may be requeued but the database side effect remains, leading to duplicate or inconsistent state.
Go deeper
Related to this question
About these practice questions
Courseiva writes every AZ-204 question from scratch — 881 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.