Throttling Resource Manager requests

This article describes how Azure Resource Manager throttles requests. It shows you lot how to track the number of requests that remain earlier reaching the limit, and how to respond when you've reached the limit.

Throttling happens at two levels. Azure Resources Manager throttles requests for the subscription and tenant. If the request is nether the throttling limits for the subscription and tenant, Resources Manager routes the request to the resources provider. The resource provider applies throttling limits that are tailored to its operations. The following epitome shows how throttling is practical equally a request goes from the user to Azure Resources Director and the resource provider.

Request throttling

Subscription and tenant limits

Every subscription-level and tenant-level operation is subject to throttling limits. Subscription requests are ones that involve passing your subscription ID, such as retrieving the resource groups in your subscription. Tenant requests don't include your subscription ID, such every bit retrieving valid Azure locations.

The default throttling limits per 60 minutes are shown in the following tabular array.

Scope Operations Limit
Subscription reads 12000
Subscription deletes 15000
Subscription writes 1200
Tenant reads 12000
Tenant writes 1200

These limits are scoped to the security principal (user or application) making the requests and the subscription ID or tenant ID. If your requests come from more one security principal, your limit across the subscription or tenant is greater than 12,000 and 1,200 per hour.

These limits utilise to each Azure Resource Manager instance. At that place are multiple instances in every Azure region, and Azure Resource Manager is deployed to all Azure regions. So, in practice, the limits are college than these limits. The requests from a user are commonly handled by different instances of Azure Resource Manager.

The remaining requests are returned in the response header values.

Resource provider limits

Resources providers apply their own throttling limits. Because Resource Manager throttles past main ID and by instance of Resource Manager, the resources provider might receive more requests than the default limits in the previous department.

This section discusses the throttling limits of some widely used resources providers.

Storage throttling

The following limits apply just when y'all perform management operations past using Azure Resource Manager with Azure Storage.

Resources Limit
Storage business relationship management operations (read) 800 per 5 minutes
Storage account direction operations (write) 10 per second / 1200 per hour
Storage account management operations (listing) 100 per 5 minutes

Network throttling

The Microsoft.Network resource provider applies the following throttle limits:

Operation Limit
write / delete (PUT) 1000 per 5 minutes
read (GET) 10000 per five minutes

Notation

Azure DNS and Azure Individual DNS accept a throttle limit of 500 read (Go) operations per 5 minutes.

Compute throttling

For information nigh throttling limits for compute operations, see Troubleshooting API throttling errors - Compute.

For checking virtual motorcar instances within a virtual machine scale set, use the Virtual Machine Scale Sets operations. For instance, use the Virtual Auto Scale Set VMs - List with parameters to check the ability state of virtual machine instances. This API reduces the number of requests.

Azure Resource Graph throttling

Azure Resource Graph limits the number of requests to its operations. The steps in this article to determine the remaining requests and how to reply when the limit is reached also utilize to Resource Graph. However, Resource Graph sets its own limit and reset rate. For more than information, see Resource Graph throttling headers.

Other resources providers

For information nearly throttling in other resource providers, come across:

  • Azure Key Vault throttling guidance
  • AKS troubleshooting

Error code

When yous accomplish the limit, you lot receive the HTTP condition code 429 Likewise many requests. The response includes a Retry-After value, which specifies the number of seconds your awarding should wait (or sleep) before sending the next asking. If you send a asking before the retry value has elapsed, your request isn't processed and a new retry value is returned.

After waiting for specified time, y'all can besides close and reopen your connection to Azure. By resetting the connection, yous may connect to a different example of Azure Resource Manager.

If you're using an Azure SDK, the SDK may have an auto retry configuration. For more than information, meet Retry guidance for Azure services.

Some resource providers return 429 to study a temporary problem. The problem could be an overload status that isn't direct acquired by your request. Or, it could represent a temporary error about the state of the target resources or dependent resource. For case, the network resource provider returns 429 with the RetryableErrorDueToAnotherOperation mistake code when the target resource is locked past another operation. To determine if the fault comes from throttling or a temporary status, view the error details in the response.

Remaining requests

You can determine the number of remaining requests by examining response headers. Read requests return a value in the header for the number of remaining read requests. Write requests include a value for the number of remaining write requests. The following tabular array describes the response headers you can examine for those values:

Response header Clarification
10-ms-ratelimit-remaining-subscription-deletes Subscription scoped deletes remaining. This value is returned on delete operations.
x-ms-ratelimit-remaining-subscription-reads Subscription scoped reads remaining. This value is returned on read operations.
x-ms-ratelimit-remaining-subscription-writes Subscription scoped writes remaining. This value is returned on write operations.
x-ms-ratelimit-remaining-tenant-reads Tenant scoped reads remaining
10-ms-ratelimit-remaining-tenant-writes Tenant scoped writes remaining
x-ms-ratelimit-remaining-subscription-resource-requests Subscription scoped resources type requests remaining.

This header value is only returned if a service has overridden the default limit. Resource Manager adds this value instead of the subscription reads or writes.

x-ms-ratelimit-remaining-subscription-resources-entities-read Subscription scoped resource type collection requests remaining.

This header value is but returned if a service has overridden the default limit. This value provides the number of remaining collection requests (list resources).

x-ms-ratelimit-remaining-tenant-resource-requests Tenant scoped resources blazon requests remaining.

This header is only added for requests at tenant level, and simply if a service has overridden the default limit. Resource Managing director adds this value instead of the tenant reads or writes.

x-ms-ratelimit-remaining-tenant-resource-entities-read Tenant scoped resources type collection requests remaining.

This header is only added for requests at tenant level, and but if a service has overridden the default limit.

The resources provider tin can too render response headers with information nearly remaining requests. For information about response headers returned by the Compute resource provider, encounter Call charge per unit informational response headers.

Retrieving the header values

Retrieving these header values in your code or script is no dissimilar than retrieving any header value.

For example, in C#, yous retrieve the header value from an HttpWebResponse object named response with the post-obit code:

              response.Headers.GetValues("ten-ms-ratelimit-remaining-subscription-reads").GetValue(0)                          

In PowerShell, you retrieve the header value from an Invoke-WebRequest operation.

              $r = Invoke-WebRequest -Uri https://management.azure.com/subscriptions/{guid}/resourcegroups?api-version=2016-09-01 -Method Go -Headers $authHeaders $r.Headers["x-ms-ratelimit-remaining-subscription-reads"]                          

For a consummate PowerShell example, meet Check Resources Manager Limits for a Subscription.

If you lot want to see the remaining requests for debugging, you tin can provide the -Debug parameter on your PowerShell cmdlet.

              Become-AzResourceGroup -Debug                          

Which returns many values, including the following response value:

              DEBUG: ============================ HTTP RESPONSE ============================  Status Code: OK  Headers: Pragma                        : no-cache x-ms-ratelimit-remaining-subscription-reads: 11999                          

To get write limits, use a write performance:

              New-AzResourceGroup -Proper name myresourcegroup -Location westus -Debug                          

Which returns many values, including the following values:

              DEBUG: ============================ HTTP RESPONSE ============================  Status Code: Created  Headers: Pragma                        : no-enshroud ten-ms-ratelimit-remaining-subscription-writes: 1199                          

In Azure CLI, you lot retrieve the header value by using the more verbose choice.

              az group list --verbose --debug                          

Which returns many values, including the following values:

              msrest.http_logger : Response status: 200 msrest.http_logger : Response headers: msrest.http_logger :     'Cache-Control': 'no-cache' msrest.http_logger :     'Pragma': 'no-cache' msrest.http_logger :     'Content-Type': 'application/json; charset=utf-eight' msrest.http_logger :     'Content-Encoding': 'gzip' msrest.http_logger :     'Expires': '-ane' msrest.http_logger :     'Vary': 'Have-Encoding' msrest.http_logger :     'x-ms-ratelimit-remaining-subscription-reads': '11998'                          

To get write limits, use a write performance:

              az grouping create -due north myresourcegroup --location westus --verbose --debug                          

Which returns many values, including the following values:

              msrest.http_logger : Response condition: 201 msrest.http_logger : Response headers: msrest.http_logger :     'Enshroud-Command': 'no-cache' msrest.http_logger :     'Pragma': 'no-cache' msrest.http_logger :     'Content-Length': '163' msrest.http_logger :     'Content-Type': 'application/json; charset=utf-eight' msrest.http_logger :     'Expires': '-1' msrest.http_logger :     'x-ms-ratelimit-remaining-subscription-writes': '1199'                          

Next steps

  • For a complete PowerShell instance, see Check Resources Manager Limits for a Subscription.
  • For more information virtually limits and quotas, encounter Azure subscription and service limits, quotas, and constraints.
  • To learn about handling asynchronous REST requests, meet Track asynchronous Azure operations.