Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Check and manage Azure subscription quotas, usage limits, and request capacity increases
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/commands.md
1# Azure Quota CLI Commands Reference23Comprehensive reference for Azure CLI quota commands.45## Prerequisites67**Install quota extension** (required):8```bash9az extension add --name quota10```1112> **⚠️ CRITICAL: ALWAYS USE CLI FIRST**13>14> Azure CLI is the **ONLY reliable method** for quota checks. **Use `az quota` commands FIRST, always.**15>16> **DO NOT use REST API or Azure Portal as your first approach.** They are unreliable.17>18> **Required workflow:**19> 1. **FIRST:** Try `az quota list` / `az quota show` / `az quota usage show`20> 2. **If CLI returns `BadRequest`:** Resource provider doesn't support quota API → use [Azure service limits docs](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits)21> 3. **Never start with REST API or Portal** - only use as fallback22>23> **Why REST API/Portal are unreliable:**24> - REST API returns "No Limit" or "Unlimited" values that are **MISLEADING**25> - "No Limit" **DOES NOT mean unlimited capacity** - usually means resource doesn't support quota API26> - Service-specific limits still apply even when REST API shows "No Limit"27> - Portal may show incomplete or cached quota data28> - REST API lacks proper error handling for unsupported providers29>30> **If you see "No Limit" in REST API/Portal:**31> - ❌ This is NOT unlimited capacity32> - ✅ It means quota API doesn't support that resource type33> - ✅ Check [Azure service limits docs](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits) for actual limits34> - ✅ Regional capacity constraints may still exist3536## Resource Name Mapping3738**⚠️ CRITICAL:** No 1:1 mapping exists between ARM resource types and quota names. Always discover via `az quota list`.3940**Discovery workflow**:411. List all quotas: `az quota list --scope /subscriptions/{id}/providers/{Provider}/locations/{region}`422. Match `properties.name.localizedValue` to your resource type433. Use exact `name` value in subsequent commands4445**Example mappings**:4647| ARM Type | Quota Name |48|----------|-----------|49| `Microsoft.App/managedEnvironments` | `ManagedEnvironmentCount` |50| `Microsoft.Compute/virtualMachines` | `standardDSv3Family`, `cores`, `virtualMachines` |51| `Microsoft.Network/publicIPAddresses` | `PublicIPAddresses`, `IPv4StandardSkuPublicIpAddresses` |5253## Command Summary5455| Command | Description |56|---------|-------------|57| [az quota list](#az-quota-list) | List all quota limits for a scope |58| [az quota show](#az-quota-show) | Show quota limit for specific resource |59| [az quota usage list](#az-quota-usage-list) | List current usage for all resources |60| [az quota usage show](#az-quota-usage-show) | Show current usage for specific resource |61| [az quota update](#az-quota-update) | Request quota increase |62| [az quota create](#az-quota-create) | Create quota limit (advanced) |6364See [advanced-commands.md](advanced-commands.md) for request status and operation commands.6566---6768## az quota list6970List all quota limits for a scope. **Use this first to discover quota resource names.**7172**Syntax**:73```bash74az quota list --scope SCOPE [--max-items N] [--next-token TOKEN]75```7677**Required**:78- `--scope` - Azure resource URI: `/subscriptions/{id}/providers/{Provider}/locations/{region}`7980**Examples**:81```bash82# List compute quotas83az quota list --scope /subscriptions/{id}/providers/Microsoft.Compute/locations/eastus8485# List network quotas86az quota list --scope /subscriptions/{id}/providers/Microsoft.Network/locations/eastus8788# Table format89az quota list --scope /subscriptions/{id}/providers/Microsoft.Compute/locations/eastus --output table90```9192**Key output fields**:93- `name` - Quota resource name (use in other commands)94- `properties.name.localizedValue` - Human-readable description95- `properties.limit.value` - Quota limit9697---9899## az quota show100101Show quota limit for a specific resource.102103**Syntax**:104```bash105az quota show --resource-name NAME --scope SCOPE106```107108**Required**:109- `--resource-name` - Quota resource name (from `az quota list`)110- `--scope` - Azure resource URI111112**Example**:113```bash114# Get DSv3 family vCPU limit115az quota show \116--resource-name standardDSv3Family \117--scope /subscriptions/{id}/providers/Microsoft.Compute/locations/eastus118```119120**Key output fields**:121- `properties.limit.value` - Quota limit122- `properties.name.localizedValue` - Human-readable description123- `properties.quotaPeriod` - Reset period (e.g., P1M = 1 month)124125---126127## az quota update128129Request quota increase for a resource.130131**Syntax**:132```bash133az quota update --resource-name NAME --scope SCOPE --limit-object value=N [--resource-type TYPE] [--no-wait]134```135136**Required**:137- `--resource-name` - Quota resource name138- `--scope` - Azure resource URI139- `--limit-object` - New limit value (format: `value=N`)140141**Optional**:142- `--resource-type` - Resource type (e.g., dedicated, lowPriority)143- `--no-wait` - Don't wait for completion (true/false)144145**Examples**:146```bash147# Increase FSv2 family vCPUs to 100148az quota update \149--resource-name standardFSv2Family \150--scope /subscriptions/{id}/providers/Microsoft.Compute/locations/eastus \151--limit-object value=100 \152--resource-type dedicated153154# Non-blocking request155az quota update \156--resource-name standardFSv2Family \157--scope /subscriptions/{id}/providers/Microsoft.Compute/locations/eastus \158--limit-object value=100 \159--no-wait true160```161162---163164## az quota usage list165166List current usage for all resources in a scope.167168**Syntax**:169```bash170az quota usage list --scope SCOPE [--max-items N] [--next-token TOKEN]171```172173**Required**:174- `--scope` - Azure resource URI175176**Examples**:177```bash178# List compute usage179az quota usage list --scope /subscriptions/{id}/providers/Microsoft.Compute/locations/eastus180181# Table format182az quota usage list --scope /subscriptions/{id}/providers/Microsoft.Compute/locations/eastus --output table183```184185**Key output**:186- `properties.usages.value` - Current usage count187- Use with `az quota show` to calculate available capacity188189---190191## az quota usage show192193Show current usage for a specific resource.194195**Syntax**:196```bash197az quota usage show --resource-name NAME --scope SCOPE198```199200**Required**:201- `--resource-name` - Quota resource name202- `--scope` - Azure resource URI203204**Example**:205```bash206az quota usage show \207--resource-name standardDSv3Family \208--scope /subscriptions/{id}/providers/Microsoft.Compute/locations/eastus209```210211**Calculate available capacity**:2121. Get limit: `az quota show --resource-name {name} --scope {scope}` → limit value2132. Get usage: `az quota usage show --resource-name {name} --scope {scope}` → current usage2143. Available = Limit - Usage215216**Example calculation**:217- Limit (from `az quota show`): 350 vCPUs218- Usage (from `az quota usage show`): 12 vCPUs219- **Available**: 338 vCPUs220221---222223## az quota create224225Create quota limit for a resource. **Rarely used** - typically use `az quota update` instead.226227**Syntax**:228```bash229az quota create --resource-name NAME --scope SCOPE --limit-object value=N [--resource-type TYPE]230```231232**Required**:233- `--resource-name` - Quota resource name234- `--scope` - Azure resource URI235- `--limit-object` - Quota limit value236237**Examples**:238```bash239# Create network quota240az quota create \241--resource-name MinPublicIpInterNetworkPrefixLength \242--scope /subscriptions/{id}/providers/Microsoft.Network/locations/eastus \243--limit-object value=10 \244--resource-type MinPublicIpInterNetworkPrefixLength245246# Create ML quota247az quota create \248--resource-name TotalLowPriorityCores \249--scope /subscriptions/{id}/providers/Microsoft.MachineLearningServices/locations/eastus \250--limit-object value=10 \251--resource-type lowPriority252```253254---255256## Troubleshooting257258### Unsupported Resource Types259260Not all Azure resource providers support the quota API. If you receive a `BadRequest` error when running `az quota list`, the provider likely doesn't support quota commands.261262**Example - Microsoft.DocumentDB (Cosmos DB)**:263```bash264az quota list --scope /subscriptions/{id}/providers/Microsoft.DocumentDB/locations/eastus265# Error: (BadRequest) Bad request266```267268**Workarounds**:269- Check [Azure subscription limits documentation](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits)270- Use Azure Portal for quota management271- Check service-specific documentation272273**Testing provider support**:274```bash275# Try listing quotas276az quota list --scope /subscriptions/{id}/providers/{Provider}/locations/{region}277278# BadRequest error → not supported279# List of quotas → supported280```281282### REST API "No Limit" Warning283284> **⚠️ CRITICAL WARNING: REST API "No Limit" is MISLEADING**285>286> If you see "No Limit", "Unlimited", or similar values in REST API or Azure Portal responses:287>288> **This DOES NOT mean unlimited capacity!**289>290> It most likely means:291> - The resource provider doesn't support the quota API292> - Quota information isn't available through this API293> - The quota is managed at a different scope294>295> **DO NOT assume unlimited capacity. Always:**296> 1. Use `az quota` CLI commands first (preferred method)297> 2. If CLI returns `BadRequest`, check [Azure service limits documentation](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits)298> 3. Consult service-specific documentation for actual limits299> 4. Consider regional capacity constraints even without quota enforcement300301### Common Error Codes302303| Error | Cause | Solution |304|-------|-------|----------|305| `BadRequest` | Provider not supported by quota API | Use CLI (preferred) or check [Azure service limits docs](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits) |306| `ExtensionNotFound` | Quota extension not installed | Run `az extension add --name quota` |307| `MissingRegistration` | Microsoft.Quota provider not registered | Run `az provider register --namespace Microsoft.Quota` |308| `InvalidScope` | Incorrect scope format | Verify: `/subscriptions/{id}/providers/{namespace}/locations/{region}` |309| `QuotaNotAvailableForResource` | Resource not available in region | Try different region |310| `RequestThrottled` | Too many API calls | Implement exponential backoff |311312### Known Support Status313314**Unsupported**:315- ❌ Microsoft.DocumentDB (Cosmos DB)316317**Supported**:318- ✅ Microsoft.Compute (VMs, disks, cores)319- ✅ Microsoft.Network (VNets, IPs, load balancers)320- ✅ Microsoft.App (Container Apps)321- ✅ Microsoft.Storage (storage accounts)322- ✅ Microsoft.MachineLearningServices323- ✅ Microsoft.ContainerService (AKS)324