Skip to content

Commit ad20af9

Browse files
authored
Merge pull request #206035 from dlepow/patch-138
[APIM] Retry-After default header in quota, rate-limit policies
2 parents d4a29eb + 930b47f commit ad20af9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

articles/api-management/api-management-access-restriction-policies.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ To understand the difference between rate limits and quotas, [see Rate limits an
235235
<rate-limit calls="number" renewal-period="seconds">
236236
<api name="API name" id="API id" calls="number" renewal-period="seconds">
237237
<operation name="operation name" id="operation id" calls="number" renewal-period="seconds"
238-
retry-after-header-name="header name"
238+
retry-after-header-name="custom header name, replaces default 'Retry-After'"
239239
retry-after-variable-name="policy expression variable name"
240240
remaining-calls-header-name="header name"
241241
remaining-calls-variable-name="policy expression variable name"
@@ -275,7 +275,7 @@ In the following example, the per subscription rate limit is 20 calls per 90 sec
275275
| name | The name of the API for which to apply the rate limit. | Yes | N/A |
276276
| calls | The maximum total number of calls allowed during the time interval specified in `renewal-period`. | Yes | N/A |
277277
| renewal-period | The length in seconds of the sliding window during which the number of allowed requests should not exceed the value specified in `calls`. Maximum allowed value: 300 seconds. | Yes | N/A |
278-
| retry-after-header-name | The name of a response header whose value is the recommended retry interval in seconds after the specified call rate is exceeded. | No | N/A |
278+
| retry-after-header-name | The name of a custom response header whose value is the recommended retry interval in seconds after the specified call rate is exceeded. | No | `Retry-After` |
279279
| retry-after-variable-name | The name of a policy expression variable that stores the recommended retry interval in seconds after the specified call rate is exceeded. | No | N/A |
280280
| remaining-calls-header-name | The name of a response header whose value after each policy execution is the number of remaining calls allowed for the time interval specified in the `renewal-period`. | No | N/A |
281281
| remaining-calls-variable-name | The name of a policy expression variable that after each policy execution stores the number of remaining calls allowed for the time interval specified in the `renewal-period`. | No | N/A |
@@ -312,8 +312,10 @@ For more information and examples of this policy, see [Advanced request throttli
312312
increment-condition="condition"
313313
increment-count="number"
314314
counter-key="key value"
315-
retry-after-header-name="header name" retry-after-variable-name="policy expression variable name"
316-
remaining-calls-header-name="header name" remaining-calls-variable-name="policy expression variable name"
315+
retry-after-header-name="custom header name, replaces default 'Retry-After'"
316+
retry-after-variable-name="policy expression variable name"
317+
remaining-calls-header-name="header name"
318+
remaining-calls-variable-name="policy expression variable name"
317319
total-calls-header-name="header name"/>
318320

319321
```
@@ -353,7 +355,7 @@ In the following example, the rate limit of 10 calls per 60 seconds is keyed by
353355
| increment-condition | The boolean expression specifying if the request should be counted towards the rate (`true`). | No | N/A |
354356
| increment-count | The number by which the counter is increased per request. | No | 1 |
355357
| renewal-period | The length in seconds of the sliding window during which the number of allowed requests should not exceed the value specified in `calls`. Policy expression is allowed. Maximum allowed value: 300 seconds. | Yes | N/A |
356-
| retry-after-header-name | The name of a response header whose value is the recommended retry interval in seconds after the specified call rate is exceeded. | No | N/A |
358+
| retry-after-header-name | The name of a custom response header whose value is the recommended retry interval in seconds after the specified call rate is exceeded. | No | `Retry-After` |
357359
| retry-after-variable-name | The name of a policy expression variable that stores the recommended retry interval in seconds after the specified call rate is exceeded. | No | N/A |
358360
| remaining-calls-header-name | The name of a response header whose value after each policy execution is the number of remaining calls allowed for the time interval specified in the `renewal-period`. | No | N/A |
359361
| remaining-calls-variable-name | The name of a policy expression variable that after each policy execution stores the number of remaining calls allowed for the time interval specified in the `renewal-period`. | No | N/A |
@@ -420,7 +422,7 @@ This policy can be used in the following policy [sections](./api-management-howt
420422
421423
## <a name="SetUsageQuota"></a> Set usage quota by subscription
422424

423-
The `quota` policy enforces a renewable or lifetime call volume and/or bandwidth quota, on a per subscription basis.
425+
The `quota` policy enforces a renewable or lifetime call volume and/or bandwidth quota, on a per subscription basis. When the quota is exceeded, the caller receives a `403 Forbidden` response status code, and the response includes a `Retry-After` header whose value is the recommended retry interval in seconds.
424426

425427
To understand the difference between rate limits and quotas, [see Rate limits and quotas.](./api-management-sample-flexible-throttling.md#rate-limits-and-quotas)
426428

@@ -485,7 +487,7 @@ This policy can be used in the following policy [sections](./api-management-howt
485487
> [!IMPORTANT]
486488
> This feature is unavailable in the **Consumption** tier of API Management.
487489
488-
The `quota-by-key` policy enforces a renewable or lifetime call volume and/or bandwidth quota, on a per key basis. The key can have an arbitrary string value and is typically provided using a policy expression. Optional increment condition can be added to specify which requests should be counted towards the quota. If multiple policies would increment the same key value, it is incremented only once per request. When the call rate is exceeded, the caller receives a `403 Forbidden` response status code.
490+
The `quota-by-key` policy enforces a renewable or lifetime call volume and/or bandwidth quota, on a per key basis. The key can have an arbitrary string value and is typically provided using a policy expression. Optional increment condition can be added to specify which requests should be counted towards the quota. If multiple policies would increment the same key value, it is incremented only once per request. When the quota is exceeded, the caller receives a `403 Forbidden` response status code, and the response includes a `Retry-After` header whose value is the recommended retry interval in seconds.
489491

490492
For more information and examples of this policy, see [Advanced request throttling with Azure API Management](./api-management-sample-flexible-throttling.md).
491493

0 commit comments

Comments
 (0)