Question

Difficulty: EasyDefine API Management Policies

You are setting up an API gateway in Azure API Management. You need to restrict client access to a specific range of IP addresses and enable response caching for incoming requests. Which two of the following policy elements must be placed inside the <inbound> section of the policy XML to achieve this?

  1. ip-filterAnswer
  2. cache-lookupAnswer
  3. C
    cache-store
  4. D
    forward-request

Answer

To restrict client IP addresses and enable response caching, the ip-filter and cache-lookup policies must be placed in the inbound section of the policy XML.
The policies ip-filter and cache-lookup are used to inspect and filter incoming requests before sending them to the backend service. Therefore, they must be placed in the inbound section of the Azure API Management policy document. Specifically, ip-filter restricts access based on client IP ranges, and cache-lookup checks for cached responses.

Step-by-Step Solution

1
Identify the section of the API Management policy document that executes before a request is sent to the backend.
The inbound section is evaluated first when a client request arrives.
This is where pre-processing policies, such as request filtering and cache checking, must run.
2
Determine which policy filters client requests by IP address.
The ip-filter policy allows or blocks specific IP addresses and runs during incoming request processing.
This must be placed in the inbound section to block unwanted traffic early.
3
Determine which caching policy is required to check for existing cached responses.
The cache-lookup policy checks the cache and must be placed in the inbound section.
If a cached response exists, it is returned immediately, bypassing the backend. The corresponding cache-store policy is placed in the outbound section to cache the backend response.

Key Concept

Azure API Management policy sections control when policies are executed relative to the backend request. Inbound processing policies like ip-filter and cache-lookup must reside in the inbound section.
Rate this question