QuestionQ48

Connect to and consume Azure services and third-party services

Contoso, Ltd. provides an API to customers by using Azure API Management (APIM). The API authorizes users by using a JWT token.

You must implement response caching for the APIM gateway. The caching mechanism must identify the client user ID that accesses data for a given location and cache the response for that user ID.

You need to add the following policies to the policies file:

  • a set-variable policy to store the detected user identity
  • a cache-lookup-value policy
  • a cache-store-value policy
  • a find-and-replace policy to update the response body with the user profile information

To which policy section should you add the policies? Each section may be used once, more than once, or not at all.

Drag & Drop
Set-variable
Cache-lookup-value
Cache-store-value
Find-and-replace
Explanation

set-variable extracts and saves the JWT identity before backend processing, and cache-lookup-value checks for the user-specific cached value on the inbound request. cache-store-value stores the result after it is available, and find-and-replace modifies the response body; both belong in the outbound section.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!