DRAG DROP –
Contoso, Ltd. provides an API to customers by using Azure API Management (APIM). The API authorizes users with a JWT token.
You must implement response caching for the APIM gateway. The caching mechanism must detect the user ID of the client 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? To answer, drag the appropriate sections to the correct policies. Each section may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:
Box 1: Inbound.
A set-variable policy to store the detected user identity.
<!– How you determine user identity is application dependent –>
value=”@(context.Request.Headers.GetValueOrDefault(“Authorization”,””).Split(‘ ‘).AsJwt()?.Subject)” />
Box 2: Inbound –
A cache-lookup-value policy –
<cache-lookup vary-by-developer=”true | false” vary-by-developer-groups=”true | false” downstream-caching-type=”none | private | public” must- revalidate=”true | false”>
<vary-by-query-parameter>parameter name</vary-by-query-parameter> <!– optional, can repeated several times –>
Box 3: Inbound –
Box 4: Outbound –
A find-and-replace policy to update the response body with the user profile information.
<!– Update response body with user profile–>