Your APIM gateway forwards requests to a backend that intermittently returns 500 or 504. You must retry failed calls up to three times with a one-second delay, but only for those two status codes. Which policy configuration should you use?
Choose an answer
Tap an option to check your answer.
Correct answer: Wrap the backend call with a retry policy: <retry count="3" interval="1" condition="@(context.Response.StatusCode == 500 || context.Response.StatusCode == 504)">`<forward-request />`</retry>..
Why this is the answer
The correct option uses the retry policy with a condition attribute. This allows you to specify exactly which HTTP status codes (500 or 504 in this case) should trigger a retry, up to three times with a one-second interval. The <forward-request / element within the retry policy ensures that the backend call itself is the operation being retried. The second option is incorrect because omitting the condition attribute would cause APIM to retry all failed requests, not just those with 500 or 504 status codes, which is not the requirement. The third option is overly complex and inefficient; using JavaScript and send-request for retries is not the idiomatic or recommended approach when a dedicated retry policy exists. The fourth option is incorrect because setting a timeout on forward-request does not automatically trigger retries; it only defines how long APIM waits for a response before timing out the request.
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