Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Select, configure, and scale Azure compute resources—VMs, App Service, AKS, and Container Apps
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/vm-quotas.md
1# VM Quota Validation Guide23Check Azure VM/VMSS quota availability before recommending or deploying. Ensures the subscription and region have sufficient vCPU capacity.45> ⚠️ **NEVER use the `azure-quota` MCP server as as It is unreliable.** Always try `az quota` CLI commands first.67## Quota Structure89VM quotas are tracked at **two levels** under `Microsoft.Compute`:1011| Quota Level | Resource Name | What It Limits |12|---|---|---|13| **Total Regional** | `cores` | All vCPUs across all families in a region |14| **Per-Family** | e.g., `standardDSv3Family` | vCPUs for a specific VM family |1516> ⚠️ **Both levels must have capacity.** A deployment fails if either is exceeded.1718### Common Quota Resource Names1920See [vm-families.md](./vm-families.md) for quota resource names per VM family. Use `az quota list` to discover names not listed there.2122> ⚠️ **Do NOT guess quota names from SKU names.** Use `az quota list` to discover correct resource names.2324## Quota Check Workflow2526### Option A: `az vm list-usage` (Recommended for VM quotas)2728No extension required. Returns **both current usage and limit in a single call** for all VM families in a region — equivalent to running `az quota usage show` and `az quota list` together for VM vCPU quotas.2930```bash31# All VM family quotas in a region32az vm list-usage --location <region> -o table3334# Filter to a specific family35az vm list-usage --location <region> --query "[?contains(name.value,'<quotaName>')].{Name:name.localizedValue, QuotaName:name.value, Current:currentValue, Limit:limit}" -o table36```3738> 💡 **Tip:** `az vm list-usage` is the simplest way to check VM quotas. Use `az quota` (Option B) when you need to **request quota increases** or manage quotas for non-VM resource types.3940### Option B: `az quota` CLI (For quota increases or non-VM resources)4142Prerequisite: `az extension add --name quota`4344| Step | Command | Purpose |45|---|---|---|46| 1. Discover names | `az quota list --scope /subscriptions/<sub-id>/providers/Microsoft.Compute/locations/<region> -o table` | Find quota resource name for the VM family |47| 2. Check usage | `az quota usage show --resource-name <name> --scope ...` | Current vCPU consumption |48| 3. Check limit | `az quota show --resource-name <name> --scope ...` | Maximum allowed vCPUs |49| 4. Check regional | Repeat steps 2–3 with `--resource-name cores` | Total regional vCPU cap |5051### Calculate Capacity5253```text54Available = Limit - Current Usage (check both family AND regional)55vCPUs Needed = vCPUs per VM × Instance Count5657✅ Deploy if: vCPUs Needed ≤ min(Family Available, Regional Available)58❌ Blocked if: either is exceeded59```6061**Example:** 3× `Standard_D4s_v5` (4 vCPUs each) = 12 needed. Family: 100−40 = 60 ✅. Regional: 350−280 = 70 ✅.6263## Handling Insufficient Quota6465| Option | Action |66|---|---|67| **Request increase** | `az quota update --resource-name <name> --scope ... --limit-object value=<new-limit> --resource-type dedicated`. Most increases auto-approve within minutes. |68| **Try different region** | Run the quota check workflow against alternative regions to find available capacity |69| **Switch VM family** | Recommend an alternative family with quota (e.g., D-series full → Dads v5 AMD variant) |7071## VMSS Considerations7273For scale sets, validate against **autoscale maximum**: `vCPUs per VM × Max Instance Count`.7475| Autoscale Setting | vCPUs to Validate |76|---|---|77| Fixed count (5 instances) | vCPUs × 5 |78| Autoscale min=2, max=10 | vCPUs × 10 |7980## Error Reference8182| Error | Cause | Action |83|---|---|---|84| `QuotaExceeded` | Family vCPU limit reached | Request increase or change family/region |85| `OperationNotAllowed` | Subscription lacks capacity | Request quota increase |86| `cores` limit hit | Regional vCPUs exhausted | Request regional increase |87| CLI commands fail entirely | Auth/extension issue | Use MCP fallback (see below) |8889## Related Resources9091- Invoke the **azure-quotas** skill for complete quota CLI workflows across all Azure providers92- [VM Family Guide](vm-families.md) — Family-to-workload mapping93- [Azure VM quotas documentation](https://learn.microsoft.com/en-us/azure/virtual-machines/quotas)94