AZ-204 Develop for Azure storage Practice Question
You are processing messages from an Azure Storage queue in a worker role. To handle messages that repeatedly fail, you want to move them to a separate 'poison' queue after 5 delivery attempts. Which property of the received message should you check to determine the number of attempts?
⚠ Common exam trap
Candidates often confuse PopReceipt (which changes with each dequeue and is used for deletion) with DequeueCount, assuming a new PopReceipt indicates a new attempt, but PopReceipt does not provide a cumulative count of attempts.
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
✓
DequeueCount
The DequeueCount property tracks how many times a message has been dequeued from the queue. Each time a worker role retrieves the message but fails to process it (and does not delete it), the message becomes visible again after the visibility timeout expires, incrementing DequeueCount. By checking this property, you can implement a retry policy that moves the message to a poison queue after a threshold (e.g., 5 attempts).
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
MessageId
Why it's wrong here
The MessageId is a globally unique identifier assigned to a message when it is first enqueued into Azure Queue Storage. This identifier remains constant throughout the message's lifecycle within the queue, regardless of how many times it is retrieved or processed. Therefore, it provides no indication of the number of dequeue attempts, making it unsuitable for detecting messages that repeatedly fail processing.
- ✓
DequeueCount
Why this is correct
The DequeueCount property is incremented by Azure Queue Storage each time a message is successfully retrieved using the GetMessages operation. This count directly reflects the number of times a message has been made visible to a consumer, even if it's subsequently put back into the queue due to processing failure or timeout. It is the primary mechanism for identifying 'poison messages' that repeatedly fail to process, enabling robust error handling strategies like moving them to a dead-letter queue after a predefined threshold.
- ✗
ExpirationTime
Why it's wrong here
The ExpirationTime specifies the Coordinated Universal Time (UTC) when a message will automatically be removed from the queue, regardless of its processing status. This property is set upon message creation, either explicitly by the sender or defaulting to seven days if not specified. It defines the maximum lifespan of a message in the queue but offers no insight into how many times a worker role has attempted to process it.
- ✗
PopReceipt
Why it's wrong here
The PopReceipt is a temporary, opaque string returned by Azure Queue Storage when a message is retrieved using GetMessages. It acts as a lease or proof of ownership, and is required along with the MessageId to delete or update the message while it is invisible to other consumers. Since a new PopReceipt is issued each time a message is retrieved, it does not cumulatively track the total number of dequeue attempts.
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.