You operate a single APIM API that must route traffic to one of two regional backends based on the X-Region request header (values: eu or us). The backends are preconfigured in APIM with backend-ids orders-eu and orders-us. You must keep a single API surface and route dynamically per request. What should you do?
Choose an answer
Tap an option to check your answer.
Correct answer: Use a choose policy in inbound to read the X-Region header and call set-backend-service with the appropriate backend-id..
Why this is the answer
The choose policy with set-backend-service is the correct approach because it allows dynamic routing to different pre-configured backends within a single API surface based on request headers. The choose policy evaluates conditions (like the X-Region header) and applies policies conditionally. set-backend-service then directs the request to the specified backend. rewrite-uri modifies the path of the request, not the backend host itself, so it cannot switch between different backend services. Creating two separate APIs would violate the requirement of maintaining a single API surface. A 302 redirect would force the client to make a new request directly to the backend, bypassing APIM for the second call, which is not the desired behavior for dynamic routing within APIM.
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