Microsoft Azure Developer Associate AZ-204 Practice Question
You manage an Azure API Management instance that protects its operations with Azure AD-issued JWT bearer tokens. Compliance requires that every tenant, identified by the tenantId claim inside each token, be limited to at most 1 000 calls per one-hour period across the entire API. Other tenants must not be affected by a busy tenant's traffic. Which inbound policy should you implement, and how should you configure it to meet the requirement?
Insert a quota-by-key policy with calls="1000", renewal-period="3600", counter-key="@(context.Request.Headers["tenantId"])", applied at the API scope.
Declare a set-variable policy that stores tenantId, followed by a quota policy referencing that variable to cap requests at 1 000 per hour.
Insert a rate-limit-by-key policy with calls="1000", renewal-period="3600", counter-key="@(context.Principal.Claims["tenantId"].Value)", applied at the API scope.
Insert a rate-limit policy with calls="1000", renewal-period="3600" at the product scope; no key is needed because the policy counts per caller automatically.
The rate-limit-by-key policy is designed to throttle traffic for each distinct value of a caller-supplied key. By setting calls="1000" and renewal-period="3600" you define a sliding counter of 1 000 calls per 3 600 seconds (one hour). Supplying counter-key="@(context.Principal.Claims["tenantId"]?.Value)" uses the tenantId claim from the already validated JWT as the discriminator, so each tenant gets an independent counter. The simpler rate-limit policy cannot separate traffic by tenant, quota policies accumulate over a subscription's lifetime, and adding an extra variable with a separate quota step is unnecessary because rate-limit-by-key performs the task in a single policy statement.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a JWT bearer token?
Open an interactive chat with Bash
How does the rate-limit-by-key policy function in Azure API Management?
Open an interactive chat with Bash
Why is rate-limit-by-key better suited for tenant-specific limits than quota or rate-limit policies?
Open an interactive chat with Bash
Microsoft Azure Developer Associate AZ-204
Connect to and consume Azure services and third-party services
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .