You have a Service Bus–triggered Azure Function that calls a throttled downstream API. On transient failures, you want up to 5 retries using exponential backoff with delays from 2 seconds to 1 minute. After retries, the message should be dead-lettered by Service Bus. How should you configure retries?
Choose an answer
Tap an option to check your answer.
Correct answer: Add to host.json: "retry": { "strategy": "exponentialBackoff", "maxRetryCount": 5, "minimumInterval": "00:00:02", "maximumInterval": "00:01:00" }..
Why this is the answer
The correct approach is to configure the retry policy in the host.json file. Azure Functions provides built-in retry capabilities for trigger-based functions, including Service Bus. The exponentialBackoff strategy, maxRetryCount of 5, and minimumInterval and maximumInterval settings directly align with the requirements for exponential backoff between 2 seconds and 1 minute. If all retries fail, the Service Bus trigger will eventually dead-letter the message, fulfilling that requirement. The fixedDelay strategy is incorrect because it doesn't implement exponential backoff. Setting MaxDeliveryCount on the Service Bus queue alone doesn't provide the desired exponential backoff retry logic within the function execution itself; it only controls when Service Bus dead-letters the message after multiple failed deliveries. Implementing Polly inside the function code is an option for HTTP calls from the function, but for retrying the function execution itself due to trigger failures, the built-in host.json retry policy is the most direct and efficient solution.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed