AZ-204 Develop Azure compute solutions Practice Question
Your Azure Functions app uses a consumption plan and processes messages from an Azure Service Bus queue. You notice that message processing takes up to 10 minutes, and some messages are being processed multiple times. What is the most likely cause?
⚠ Common exam trap
Many candidates assume duplicate processing is caused by scaling or retry policies, when in fact it is the lock duration being shorter than the processing time that directly leads to message re-delivery.
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
✓
The lock duration on the Service Bus queue is shorter than the processing time.
The default lock duration for a Service Bus queue is 30 seconds, which is far shorter than the 10-minute processing time. When the lock expires, the message becomes visible to other consumers, causing duplicate processing. While Azure Functions attempts to automatically renew the message lock during processing, this auto-renewal has a maximum duration (default 5 minutes). Since the processing time (10 minutes) exceeds this duration, the lock will eventually expire, leading to the message becoming available for re-delivery.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The max delivery count for the queue is set too low.
Why it's wrong here
When the MaxDeliveryCount for a Service Bus message is exceeded, the message is automatically moved to the dead-letter queue. This mechanism prevents messages from being processed indefinitely if a function consistently fails to complete them. Therefore, a low MaxDeliveryCount would result in messages being dead-lettered quickly, rather than being repeatedly reprocessed by the function, which would manifest as duplicate processing.
- ✗
The function host is configured with a low maximum instance count.
Why it's wrong here
A low maximum instance count for an Azure Functions app on a Consumption plan limits the number of concurrent function instances that can process messages. While this might lead to slower overall processing or a backlog of messages if the message volume is high, it does not inherently cause individual messages to be processed multiple times. Each instance still attempts to process a message once, acquiring a lock to prevent immediate reprocessing.
- ✓
The lock duration on the Service Bus queue is shorter than the processing time.
Why this is correct
In Service Bus's peek-lock mode, a message is locked for a specific duration when received by a function. If the function's processing time exceeds this lock duration and the lock is not explicitly renewed, the lock automatically expires. Upon expiration, the message becomes visible and available again in the queue, allowing another function instance (or even the same instance) to pick it up and process it anew, leading directly to duplicate processing.
- ✗
The function does not handle poison messages correctly.
Why it's wrong here
A poison message is one that consistently fails processing, often due to malformed data or unhandled exceptions within the function. Azure Service Bus, in conjunction with Azure Functions, uses the MaxDeliveryCount property to identify such messages. Once a message's delivery count exceeds this threshold, it is automatically moved to the dead-letter queue, preventing it from being reprocessed indefinitely and thus not causing duplicate processing in the main queue.
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
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.
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
One of 881 original AZ-204 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.