AZ-204 Develop Azure compute solutions Practice Question
Your Azure Function app uses an Event Hub trigger. Under high load, some events are processed multiple times. You need to ensure exactly-once processing without losing events. What should you implement?
⚠ Common exam trap
It's easy for candidates to confuse checkpointing with deduplication, assuming it guarantees exactly-once processing, when in reality checkpointing only tracks read progress and does not prevent duplicate event delivery within the same batch or across restarts.
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
✓
Make the function idempotent
Making the function idempotent ensures that even if the Event Hub trigger delivers the same event multiple times (which can happen under high load due to at-least-once delivery semantics), the function's side effects are safe to repeat. Idempotency is the only reliable way to achieve exactly-once processing in a distributed system where the trigger itself does not guarantee deduplication.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Make the function idempotent
Why this is correct
When an Azure Function processes Event Hub messages, especially under high load or transient errors, messages can be delivered multiple times due to the at-least-once delivery guarantee. Implementing idempotency means designing the function's logic so that processing the same event multiple times produces the same result as processing it once, without adverse side effects. This typically involves using a unique identifier from the event to check if the operation has already been completed before performing it again, often by storing processing status in a durable store like Azure Cosmos DB or Table Storage.
- ✗
Use Azure Queue Storage instead
Why it's wrong here
While Azure Queue Storage is excellent for reliable message delivery and decoupling, simply switching to it does not inherently solve the problem of duplicate processing if the underlying issue is related to retries or at-least-once delivery semantics. Queues themselves can also experience duplicate messages under certain failure scenarios, requiring similar deduplication strategies at the consumer level. Therefore, it's a different messaging service but doesn't automatically provide deduplication without additional application logic.
- ✗
Enable checkpointing
Why it's wrong here
Checkpointing in Event Hubs (and by extension, Azure Functions with Event Hub triggers) is crucial for tracking the progress of a consumer group across partitions. It allows the function to resume processing from the last successfully processed event offset after a restart or failure, preventing reprocessing of *already committed* events. However, checkpointing does not prevent the Event Hub service from delivering the *same event* multiple times due to transient network issues or consumer failures *before* a successful checkpoint, which is where idempotency becomes vital.
- ✗
Increase the batch size
Why it's wrong here
Increasing the batch size for an Event Hub trigger means the function will receive and process more events in a single invocation. While this can improve throughput and reduce the number of function invocations, it has no bearing on whether individual events within or across batches might be delivered multiple times by the Event Hub service. The core problem of at-least-once delivery and potential duplicates remains, regardless of how many events are processed concurrently in a batch.
Go deeper
Related to this question
About these practice questions
This AZ-204 question is part of Courseiva's 881-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.