Question

Difficulty: EasyProvision and Configure Azure API Management

You are configuring inbound request processing rules for an API in Azure API Management (APIM). You need to allow cross-origin resource sharing (CORS) and limit the rate of incoming calls based on the client IP address.

Which two of the following configurations must you perform to implement these policies? (Select two.)

  1. Place the cors policy within the inbound section of the policy document.Answer
  2. Place the rate-limit-by-key policy within the inbound section of the policy document.Answer
  3. C
    Place the cors policy within the outbound section of the policy document.
  4. D
    Place the rate-limit-by-key policy within the outbound section of the policy document.

Answer

Configure both the cors policy and the rate-limit-by-key policy within the inbound section of the policy document.
Both cross-origin resource sharing (CORS) rules and client-side rate limiting are request-filtering and protection mechanisms. To be effective and functional, they must be processed on incoming requests before the API Management gateway contacts the backend service. Therefore, both policies must be placed in the inbound section of the policy document.

Step-by-Step Solution

1
Identify the phase of execution for CORS validation.
CORS validation must occur when a request arrives, before forwarding it to the backend.
This determines that the cors policy belongs in the inbound section.
2
Identify the phase of execution for rate limiting.
Rate limiting protects the backend by throttling incoming requests before they are sent to the backend.
This determines that the rate-limit-by-key policy belongs in the inbound section.

Key Concept

API Management policies are structured into sections (inbound, backend, outbound, on-error) based on when the policy should execute. Pre-processing policies like CORS and rate limiting must be placed in the inbound section.
Rate this question