AZ-204 Practice Question: Connect to and consume Azure services and third-party services
A company uses Azure Service Bus to receive order messages. Each order message must be processed exactly once, and duplicate messages are not tolerated due to financial transactions. However, the order processing system sometimes fails and retries, leading to potential duplicates. What Service Bus feature should be enabled on the message to support idempotent processing?
⚠ Common exam trap
Candidates often confuse message sessions (which guarantee order and grouping) with duplicate detection, but sessions do not prevent duplicates—they only ensure FIFO delivery within a session.
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
✓
Duplicate detection
B is correct because Azure Service Bus's duplicate detection feature uses a user-defined MessageId to identify and discard duplicate messages within a specified time window (default 10 minutes, configurable up to 7 days). This ensures exactly-once processing by preventing the same order message from being processed multiple times, even if the sender retries due to failures.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Scheduled delivery
Why it's wrong here
Scheduled delivery enables deferring the availability of a message in a queue or subscription until a specified future time. While useful for scenarios like sending reminders or processing tasks at off-peak hours, it operates solely on the message's enqueued time and has no mechanism to identify or discard messages that have already been processed or received, thus offering no protection against duplicate message delivery.
- ✓
Duplicate detection
Why this is correct
Azure Service Bus duplicate detection leverages a configurable history window to track MessageId values of all messages sent to a queue or topic. When a new message arrives with a MessageId that matches one within the detection window, Service Bus automatically discards the duplicate, ensuring that each message is processed exactly once by the consuming application. This feature is crucial for idempotent message processing, preventing unintended side effects from retries or network issues.
- ✗
Message sessions
Why it's wrong here
Message sessions in Azure Service Bus provide a mechanism for grouping related messages, ensuring that all messages belonging to a specific session are processed in order and by the same receiver. This is vital for scenarios requiring strict message ordering or stateful processing across a sequence of messages. However, sessions focus on message ordering and affinity within a logical group, not on identifying or preventing the re-delivery of an identical message that might originate from a sender retry.
- ✗
Auto-forwarding
Why it's wrong here
Auto-forwarding in Azure Service Bus allows a queue or subscription to automatically forward its messages to another queue or topic, creating a chain of processing without requiring an intermediary application. This feature simplifies routing and fan-out scenarios, enabling complex message flows. However, auto-forwarding is a routing mechanism; it merely moves messages and does not inspect message content or properties to identify and filter out duplicates, meaning any duplicates in the source would simply be forwarded to the destination.
Go deeper
Related to this question
Learn chapter
Azure Functions Development
Key term
Azure Service Bus
Azure Service Bus is a cloud-based message broker that allows applications, services, and devices to send and receive messages reliably, even when they are not all running at the same time.
Key term
Azure Relay
Azure Relay is a cloud service that securely exposes on-premises web services to the public internet or other cloud applications without opening firewall ports.
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.