Question

Difficulty: EasyDefine API Management Policies

You are developing a web API and exposing it through Azure API Management. You must implement a policy that filters incoming requests to ensure they originate only from a specific range of IP addresses. In which section of the API Management policy document should you define the IP filtering policy?

  1. inboundAnswer
  2. B
    backend
  3. C
    outbound
  4. D
    on-error

Answer

The inbound section is the correct location for the IP filtering policy because it processes requests before they are sent to the backend service.
The inbound section is executed immediately when a request is received by the API Management gateway and before it is forwarded to the backend. Policies designed to inspect, authorize, rate-limit, or filter client requests, such as the ip-filter policy, must be placed within this section.

Step-by-Step Solution

1
Analyze the policy requirement.
The requirement is to filter incoming client requests based on their IP address before they reach the backend service.
This is an inbound security filter that prevents unauthorized traffic from hitting the backend API.
2
Identify the API Management policy execution pipeline stages.
The execution flow in API Management goes: inbound -> backend -> outbound. If an error occurs, it goes to on-error.
Understanding the lifecycle of a request in Azure API Management is key to placing policies in the correct section.
3
Select the appropriate section for request filtering.
The inbound section executes first, making it the only appropriate place to filter client requests based on IP addresses.
Placing the filter here ensures that requests from invalid IP addresses are rejected early, saving backend resources.

Key Concept

Azure API Management policy execution order and section placement
Estimated Time:45s
Rate this question