Courseiva

AZ-204 Practice Question: Connect to and consume Azure services and third-party services

You are building an event-driven solution that processes orders from an Azure Storage Queue. Each order triggers an Azure Function. To improve reliability, you need to automatically retry processing if an exception occurs, but only up to 3 times. You must also preserve the original order message in a poison queue after max retries. Which configuration should you use in the function's host.json?

⚠ Common exam trap

Many exam-takers confuse 'maxDequeueCount' with 'batchSize' or 'prefetchCount', thinking they control retries, when in fact they control concurrency and throughput, not poison queue behavior.

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

Set 'maxDequeueCount' to 3

The 'maxDequeueCount' setting in the host.json for an Azure Storage Queue-triggered function controls the number of times a message is dequeued for processing before it is moved to the poison queue. Setting it to 3 ensures that after three failed processing attempts (due to exceptions), the message is automatically redirected to the poison queue, preserving the original message for later inspection.

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 'prefetchCount' to 3

    Why it's wrong here

    The 'prefetchCount' setting in Azure Storage Queue client libraries determines the number of messages that the client proactively fetches from the queue and caches locally. This mechanism enhances throughput by ensuring messages are readily available for processing, thereby reducing the latency associated with individual 'GetMessages' calls. However, 'prefetchCount' solely optimizes message retrieval efficiency and has no direct influence on the number of times a specific message is retried for processing before being considered a failure.

  • Set 'newBatchThreshold' to 3

    Why it's wrong here

    The 'newBatchThreshold' parameter, often found in client-side queue processing configurations, dictates when the client should initiate a request to fetch an additional batch of messages from the Azure Storage Queue service. For instance, if set to 3, a new batch might be requested once only three messages remain within the client's local message buffer. This setting is exclusively concerned with managing the client-side message cache and does not configure the retry logic for individual message processing failures.

  • Set 'maxDequeueCount' to 3

    Why this is correct

    The 'maxDequeueCount' is a critical property of an Azure Storage Queue message that directly governs its retry mechanism and eventual dead-lettering. Each time a message is retrieved from the queue, its 'DequeueCount' property increments. If message processing fails and the message is not deleted within its visibility timeout, it becomes visible again, and its 'DequeueCount' further increases upon subsequent retrieval. Once this 'DequeueCount' reaches the 'maxDequeueCount' value (e.g., 3 in this scenario), the Azure Storage Queue service automatically moves the message to a designated poison message queue, preventing infinite retries and allowing for manual inspection.

  • Set 'batchSize' to 3

    Why it's wrong here

    The 'batchSize' parameter, when used with Azure Storage Queues, typically specifies the maximum number of messages that a single 'GetMessages' operation can retrieve from the queue in one network request. This setting primarily impacts the efficiency of message retrieval by allowing multiple messages to be fetched concurrently, reducing overhead. While it influences the rate at which messages are consumed, it does not determine the number of processing attempts for an individual message before it is considered failed or moved to a poison queue.

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 →

How Courseiva writes practice questions · Editorial policy

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.