AZ-204 Practice Question: Connect to and consume Azure services and third-party services
A function consumes messages from Azure Service Bus. Which two settings help handle transient failures safely? The design must avoid adding custom operational scripts.
⚠ Common exam trap
Watch out — candidates often confuse disabling lock renewal as a way to handle long processing times, but it actually causes message abandonment and reprocessing, not safe transient failure handling.
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
✓
Configure max delivery count with a dead-letter queue
Configuring a max delivery count with a dead-letter queue allows the system to automatically move a message to the dead-letter queue after a specified number of failed delivery attempts. This prevents poison messages from being retried indefinitely, handling transient failures safely without custom scripts. Option B is correct because idempotent message processing ensures that if a message is processed more than once due to transient failures or retries, the system state remains consistent, avoiding duplicate side effects.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Configure max delivery count with a dead-letter queue
Why this is correct
Azure Service Bus allows configuring a `MaxDeliveryCount` for a queue or subscription. When a message's delivery count exceeds this threshold, typically after multiple failed processing attempts by the function, Service Bus automatically moves the message to a dead-letter queue (DLQ). This mechanism is crucial for isolating problematic messages, preventing them from blocking the main queue, and enabling manual inspection or reprocessing without losing data.
- ✓
Make message processing idempotent
Why this is correct
Message processing idempotency ensures that executing the same operation multiple times with the same input produces the identical result as executing it once. In distributed systems like Azure Functions consuming Service Bus, messages can occasionally be delivered more than once due to network issues, retries, or lock expirations. Implementing idempotency, often by tracking processed message IDs or using unique business keys, prevents unintended side effects such as duplicate database entries or repeated external API calls, thereby ensuring data consistency and system reliability.
- ✗
Disable lock renewal for long processing
Why it's wrong here
Azure Service Bus uses peek-lock mode for message consumption, where a message is locked for a specific duration to prevent other consumers from processing it. For long-running Azure Functions, disabling automatic lock renewal means the message lock will expire before processing completes. Upon expiration, the message becomes visible again to other consumers or the original consumer on a retry, potentially leading to duplicate processing and inconsistent state, which is detrimental to reliable message handling.
- ✗
Use anonymous sender access
Why it's wrong here
Anonymous sender access to Azure Service Bus is not a supported or secure practice. Service Bus requires authentication and authorization for all operations, typically using Shared Access Signatures (SAS) or Azure Active Directory (AAD) roles. Allowing anonymous access would expose the messaging infrastructure to unauthorized entities, making it vulnerable to spam, data breaches, or denial-of-service attacks, completely undermining the security and integrity of the messaging system.
Go deeper
Related to this question
Learn chapter
Azure Functions Development
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.
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.
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.