Azure API Management · AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services
An API Management administrator wants to allow each subscription to make at most 100 calls every 60 seconds. Calls exceeding the limit should be reje…
Practice question from Azure API Management (AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services), with the correct answer and a step-by-step solution.
medium · MCQ · Q-15388D
An API Management administrator wants to allow each subscription to make at most 100 calls every 60 seconds. Calls exceeding the limit should be rejected by the gateway. Which inbound policy statement meets this requirement?
- A.<rate-limit-by-key calls="100" renewal-period="60" counter-key="@(context.Subscription.Id)" />Correct answer
- B.<quota-by-key calls="100" renewal-period="60" counter-key="@(context.Subscription.Id)" />
- C.<validate-jwt header-name="Authorization" failed-validation-httpcode="429" />
- D.<set-header name="X-Rate-Limit" exists-action="override"><value>100</value></set-header>
Solution
The rate-limit-by-key policy limits short-term request rates and can use the subscription ID as the counter key. Once the limit is exceeded, API Management returns HTTP 429. A quota controls longer-term usage totals, while the other policies do not enforce request-rate limits.
More from Azure API Management
- An API is published through Azure API Management with subscription enforcement enabled. Which HTTP header should a client normally send to…
- A company exposes a customer API through Azure API Management. The company must introduce a breaking contract change while continuing to su…
- An Azure API Management API has a backend service configured at https://api.contoso.com. One operation must instead send requests to https:…
- An API Management policy must add a payment-provider secret to an outbound request. The secret must not be stored as plaintext in the polic…
Practise more Connect to and Consume Azure and Third-party Services
Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.
Start practising freeFree to start · No credit card needed