Connect to and consume Azure services and third-party services →mediumMultiple ChoiceObjective-mapped
AZ-204 Practice Question: Connect to and consume Azure services and third-party services
You manage an API in Azure API Management. The API response varies depending on the caller's subscription key. You need to cache responses per subscription key to reduce backend load. Which policy configuration should you use?
⚠ Common exam trap
The trap here is that candidates might confuse caching policies with rate limiting or assume that a single global cache is sufficient, overlooking the need to differentiate cache entries per caller identity when the API response varies by subscription key.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Set cache key to include the subscription key
Azure API Management's caching policy allows you to customize the cache key using the `@(context.Subscription.Id)` expression. By setting the cache key to include the subscription key, each caller's responses are cached separately based on their unique subscription, ensuring that variations in the API response per subscription key are preserved while reducing backend load.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Set cache key to include the subscription key
Why this is correct
When API responses vary based on the caller's identity, such as a subscription, including the subscription key (e.g., using @(context.Subscription.Id)) in the cache key ensures that each unique subscriber receives their specific cached data. This policy prevents data leakage between subscriptions while still leveraging Azure API Management's caching capabilities to reduce backend load and improve response times for individual subscribers. It effectively creates isolated cache entries per subscription, providing personalized caching.
- ✗
Use a global cache with no variation
Why it's wrong here
Implementing a global cache without any variation mechanism would result in all API consumers receiving the exact same cached response, irrespective of their unique subscription key or specific data entitlements. This approach is fundamentally flawed when API responses are designed to be personalized or differ per subscriber, as it would lead to incorrect data being served and potential security vulnerabilities by exposing one subscriber's data to another, failing to address the requirement for varied responses.
- ✗
Disable caching and rely on the backend
Why it's wrong here
Disabling caching entirely and forcing every API request to directly hit the backend service would completely negate the performance and scalability benefits of Azure API Management's caching feature. This approach would significantly increase the load on the backend, potentially leading to higher operational costs, slower response times for API consumers, and reduced overall API availability during peak demand, thereby failing to address the core problem of reducing backend strain.
- ✗
Use rate limiting policy
Why it's wrong here
A rate limiting policy in Azure API Management is designed to control the number of requests an API consumer can make within a specified time window, preventing abuse and ensuring fair usage of backend resources. While important for API stability and resource protection, it does not involve storing or serving cached responses. Rate limiting acts as a throttle to manage request volume, whereas caching aims to reduce direct backend calls by serving previously computed results, making them distinct mechanisms for different operational concerns.
Go deeper
Related to this question
About these practice questions
This AZ-204 question is part of Courseiva's 881-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.