Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lastcoolnameleft/4cf6ceb49fdb4fb990ed163f628fa910 to your computer and use it in GitHub Desktop.
Save lastcoolnameleft/4cf6ceb49fdb4fb990ed163f628fa910 to your computer and use it in GitHub Desktop.
Azure Throttling Walkthrough
# Intro
Two types of rate limiting you might see:
- Subscription
- Resource Provider (Storage, Network Compute)
See current throttling status by looking at response headers.
Example:
* x-ms-ratelimit-remaining-resource
* x-ms-ratelimit-remaining-subscription-reads
# Read Request for VMSS
```
➜ az vmss show -n $VMSS_NAME -g $RG --debug 2>&1 | grep x-ms
DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '<GUID>'
DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-resource': 'Microsoft.Compute/GetVMScaleSet3Min;197,Microsoft.Compute/GetVMScaleSet30Min;1297'
DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '<GUID>'
DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-reads': '11999'
DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '<GUID>'
DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'SOUTHCENTRALUS:20230512T162738Z:<GUID>'
```
# Write Request
```
➜ ~ az group create -n myresourcegroup --location westus --verbose --debug --debug 2>&1 | grep 'x-ms'
DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '<GUID>'
DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-writes': '1199'
DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '<GUID>'
DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '<GUID>'
DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'SOUTHCENTRALUS:20230512T163152Z:<GUID>'
```
# Reference
https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling
https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/troubleshooting-throttling-errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment