Question

Difficulty: EasyProvision and Configure Azure API Management

You are building a microservices gateway using an Azure API Management (APIM) instance. You need to restrict access to one of the microservices by filtering incoming traffic based on the sender's IP address. In which policy section of the API's policy XML definition must you place the ip-filter policy?

  1. <inbound>Answer
  2. B
    <outbound>
  3. C
    <backend>
  4. D
    <on-error>

Answer

The <inbound> policy section
The correct answer is the <inbound> section. In Azure API Management, the policy execution pipeline is divided into four main sections: inbound, backend, outbound, and on-error. The <inbound> section is executed immediately when a request is received from a client, before it is sent to the backend. Since the goal of IP filtering is to prevent unauthorized clients from reaching the backend API, placing the ip-filter policy within the <inbound> block is correct and ensures security at the entry point.

Step-by-Step Solution

1
Analyze the security requirement to filter incoming API traffic based on the client's IP address using the ip-filter policy.
Identify that the security filter must block unauthorized requests before they consume backend resources or hit the backend microservice.
Security boundaries should evaluate and reject traffic at the earliest possible stage in the request lifecycle.
2
Evaluate the execution flow of the Azure API Management policy pipeline (inbound, backend, outbound, on-error).
Determine that the inbound phase is the only phase that runs before forwarding the request to the backend microservice.
Inbound policies process the incoming client request, backend policies control backend routing/forwarding, outbound policies modify the backend response, and on-error policies handle exceptions.
3
Map the inbound phase to the corresponding policy XML element name.
Place the ip-filter policy inside the <inbound> tag of the APIM policy document.
Syntactically and logically, IP filtering belongs inside the <inbound> processing block.

Key Concept

Azure API Management policy execution pipeline structure
Rate this question