AZ-204 Develop for Azure storage Practice Question
You are implementing a serverless function in Azure Functions that processes messages from an Azure Storage Queue. The function must ensure that each message is processed at least once and that processing failures are retried up to 5 times. After 5 failed attempts, the message should be moved to a poison queue. What should you configure?
⚠ Common exam trap
Many candidates think they need to write custom retry logic (Option B) or adjust visibility timeout (Option D), when Azure Functions provides a declarative configuration-based poison queue solution that handles retries and dead-lettering automatically.
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 the default queue poison message handling with 'maxDequeueCount' set to 5.
Azure Functions' Storage Queue trigger automatically implements a poison queue mechanism. By setting the 'maxDequeueCount' property in the host.json file to 5, the runtime will dequeue a message up to 5 times; after the 5th failed attempt, the message is automatically moved to the associated poison queue (named {originalqueue}-poison). This ensures at-least-once processing and retry handling without custom code.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Set the message time-to-live (TTL) to 5.
Why it's wrong here
Setting the message Time-To-Live (TTL) to 5 (e.g., 5 seconds, minutes, or days) dictates how long a message remains in the queue before it automatically expires and is removed, regardless of whether it has been processed. This mechanism is for message expiration, not for controlling the number of processing retries by a consumer function. A message with a TTL of 5 would simply disappear after that duration if not successfully processed, without triggering a retry count for processing attempts.
- ✗
Implement a custom retry policy in the function code with a maximum of 5 retries.
Why it's wrong here
Implementing a custom retry policy directly within the Azure Function code primarily addresses transient errors that occur *during* the function's execution, such as temporary database connection issues or external API timeouts. While useful for internal resilience, this policy does not govern the fundamental mechanism of how many times an Azure Queue Storage message is *dequeued* and made available for processing by the function. The queue itself manages the dequeue count, not the function's internal retry logic for a single execution attempt.
- ✓
Use the default queue poison message handling with 'maxDequeueCount' set to 5.
Why this is correct
The 'maxDequeueCount' property, configurable for Azure Queue Storage bindings in Azure Functions, directly controls the maximum number of times a message can be dequeued and attempted for processing before it is automatically moved to a designated poison queue. Setting 'maxDequeueCount' to 5 ensures that if a function consistently fails to process a message, it will be retried up to four additional times (five total attempts) before being sent to the poison queue for manual inspection or dead-letter processing. This is the standard, built-in mechanism for handling message processing failures and retries.
- ✗
Set the visibility timeout to 5 minutes.
Why it's wrong here
The visibility timeout determines the duration for which a dequeued message remains invisible to other consumers after it has been retrieved by a function. Its primary purpose is to prevent multiple instances of a function from processing the same message concurrently. While a message becomes visible again if not successfully processed within this timeout, leading to another dequeue attempt, the visibility timeout itself does not directly set or limit the *total number* of retries; 'maxDequeueCount' handles that.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
Learn chapter
Azure Functions Development
Key term
Azure Functions Bindings
Azure Functions Bindings are declarative connections that link your serverless function code to Azure services or external resources, handling input and output data automatically without writing extra networking or authentication code.
Key term
Durable Functions
Durable Functions is an extension of Azure Functions that lets you write stateful workflows in code, managing complex sequences of tasks, retries, and delays automatically.
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.