Microsoft Certified: Azure Developer Associate (AZ-204)Monitor, troubleshoot, and optimize Azure solutionsHard

A company has an Azure Function App that processes large image files uploaded to Azure Blob Storage. The function is triggered by new blob creation. Occasionally, the function fails due to memory exhaustion when processing extremely large and complex images. You need to implement a robust solution to handle these failures, ensuring that failed processing attempts are retried, but only for a limited number of times, and then moved to a dead-letter queue for manual inspection. Which combination of Azure services and practices should you use?

  1. AAzure Service Bus queue with message deferral and a separate queue for dead-lettering.
  2. BAzure Logic App with a 'For each' loop and 'Delay' actions.
  3. CAzure Function App with built-in retry policies and a separate Blob Storage container for dead-lettering.
  4. DAzure Event Grid for retries and Azure Queue Storage for dead-lettering.
Show answer & explanation

Correct answer: A. Azure Service Bus queue with message deferral and a separate queue for dead-lettering.

Using an Azure Service Bus queue with message deferral and a dead-letter queue is the most robust and controlled approach. The function would read from the Service Bus. If processing fails, the message can be deferred with an incremented retry counter. After a set number of retries (e.g., checking custom properties), the message can be sent to a separate dead-letter queue for manual inspection, providing precise control over retry logic and failure handling.

Why the other options are wrong

  • B. Logic Apps are not ideal for processing large files directly from blob triggers and implementing complex retry logic with dead-lettering, especially for high-volume scenarios.
  • C. Azure Functions have some built-in retry capabilities for certain bindings, but they are often limited and do not provide the granular control over message deferral, retry counts, and dead-lettering to a *separate queue* for manual inspection that Service Bus offers.
  • D. Azure Event Grid has built-in retry policies, but its dead-lettering mechanism typically sends events back to a storage account or another event handler, not a dedicated queue for complex processing, and lacks granular control over retry counts per message.

Azure Service Bus Advanced Messaging

Azure Service Bus offers advanced messaging capabilities such as dead-lettering, message deferral, and sessions, enabling robust error handling and complex workflow orchestration.

  • Dead-letter queue for unprocessable messages.
  • Message deferral to re-process messages later.
  • Supports message properties for custom retry logic.

Memory trick: For tough messages, Service Bus gives you control, retries, and a dead-letter goal.

More Monitor, troubleshoot, and optimize Azure solutions questions