Question 226 of 997

Quick Answer

The correct answer is to implement a cache-lookup policy in the inbound section and a cache-store policy in the outbound section, using the subscription key as a cache vary-by parameter. This works because the cache-lookup policy checks for a cached response keyed to the caller’s subscription before the request reaches the backend, while the cache-store policy saves the response after it is generated, ensuring that subsequent calls with the same subscription key receive the cached version. On the AZ-204 exam, this scenario tests your understanding of API Management caching policies and the vary-by mechanism, often appearing as a distractor where you might mistakenly place both policies in the inbound section or omit the vary-by parameter. A common trap is assuming a single cache entry works for all callers, but the subscription key vary-by parameter is essential for isolating responses per product key. Memory tip: think “lookup in, store out, vary by key” to recall the policy placement and the critical vary-by parameter for subscription-based caching.

AZ-204 Practice Question: Connect to and consume Azure services and third-party services

This AZ-204 practice question tests your understanding of connect to and consume azure services and third-party services. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

You manage an API in Azure API Management. You need to cache API responses such that different responses are returned based on the product subscription key used by the caller. Which set of policies should you implement?

Question 1hardmultiple choice
Full question →

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 a 'cache-lookup' policy in the inbound section and a 'cache-store' policy in the outbound section, using the subscription key as a cache vary-by parameter.

Option A is correct because caching API responses based on the subscription key ensures that each caller receives a cached response unique to their subscription. The 'cache-lookup' policy in the inbound section checks the cache before forwarding the request, and the 'cache-store' policy in the outbound section stores the response after it is generated. By specifying the subscription key as a vary-by parameter, the cache key includes the subscription key, so different keys produce different cached entries.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

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 a 'cache-lookup' policy in the inbound section and a 'cache-store' policy in the outbound section, using the subscription key as a cache vary-by parameter.

    Why this is correct

    This is the correct pattern: lookup cache on request, store on response, varying by subscription key.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Set a 'cache-store' policy in the inbound section and a 'cache-lookup' policy in the outbound section.

    Why it's wrong here

    This reverses the roles: storing on inbound before the backend is called is incorrect; caching must happen after the backend response.

  • Set both 'cache-lookup' and 'cache-store' policies in the inbound section.

    Why it's wrong here

    Both in inbound would attempt to store before the backend response, and the stored response would be empty or wrong.

  • Set only a 'cache-store' policy in the backend section.

    Why it's wrong here

    The backend section does not support caching policies; caching is done in inbound/outbound of the API.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often assume caching policies must both be in the inbound section, not realizing that 'cache-lookup' must run before the backend call and 'cache-store' must run after the response is generated, requiring them in inbound and outbound respectively.

Detailed technical explanation

How to think about this question

Under the hood, Azure API Management uses a distributed cache (internal or external Redis) where the cache key is built from the URL, HTTP method, and vary-by parameters. The subscription key is automatically available via the context variable `context.Subscription.Key`, and when used as a vary-by parameter, it ensures that responses for different subscriptions are stored separately. A real-world scenario is a multi-tenant API where each tenant has a different subscription key and expects personalized or rate-limited data; without this vary-by, one tenant's cached response could be served to another.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A cloud solutions architect for a retail company is evaluating services for a new workload. The correct answer here reflects best practice for the specific scenario described — not a general cloud recommendation. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Cloud exam questions reward reading the constraint carefully: the same technology can be right or wrong depending on the use case.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related AZ-204 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free AZ-204 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this AZ-204 question test?

Connect to and consume Azure services and third-party services — This question tests Connect to and consume Azure services and third-party services — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Set a 'cache-lookup' policy in the inbound section and a 'cache-store' policy in the outbound section, using the subscription key as a cache vary-by parameter. — Option A is correct because caching API responses based on the subscription key ensures that each caller receives a cached response unique to their subscription. The 'cache-lookup' policy in the inbound section checks the cache before forwarding the request, and the 'cache-store' policy in the outbound section stores the response after it is generated. By specifying the subscription key as a vary-by parameter, the cache key includes the subscription key, so different keys produce different cached entries.

What should I do if I get this AZ-204 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more ways this is tested on AZ-204

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. 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?

medium
  • A.Set cache key to include the subscription key
  • B.Use a global cache with no variation
  • C.Disable caching and rely on the backend
  • D.Use rate limiting policy

Why A: Option A is correct because 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.

Keep practising

More AZ-204 practice questions

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.