Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Prepare Azure environments for new workloads—subscriptions, networking, identity, and landing zones
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/resources-limits-quotas.md
1# Azure Resource Limits and Quotas23Check Azure resource availability during azure-prepare workflow. Validate after customer selects region.45## Types671. **Hard Limits** - Fixed constraints that cannot be changed82. **Quotas** - Subscription limits that can be increased via support request910**CLI First:** Always use `az quota` CLI for quota checks. Provides better error handling and consistent output. "No Limit" in REST/Portal doesn't mean unlimited - verify with service docs.1112## Hard Limits1314Fixed service constraints (cannot be changed).1516**Check via**: `azure__documentation` tool or azure-provisioning-limit skill1718**Examples**: Cosmos DB item size (2 MB), Container Apps HTTP timeout (240s), App Service Free tier deployment slots (0)1920**Process**:211. Identify services and resource sizes needed222. Look up limits in documentation233. Compare plan vs limits244. If exceeded: redesign or change tier2526## Quotas2728Subscription/regional limits that can be increased via support request.2930**Check via**: `az quota` CLI (install: `az extension add --name quota`)3132**Examples**: AKS clusters (5,000/region), Storage accounts (250/region), Container Apps environments (50/region)3334**Key Concept**: No 1:1 mapping between ARM resource types and quota names.35- ARM: `Microsoft.App/managedEnvironments` → Quota: `ManagedEnvironmentCount`36- ARM: `Microsoft.Compute/virtualMachines` → Quota: `standardDSv3Family`, `cores`, `virtualMachines`3738**Process**:391. Install extension: `az extension add --name quota`402. Discover quota names: `az quota list --scope /subscriptions/{id}/providers/{Provider}/locations/{region}`413. Check usage: `az quota usage show --resource-name {name} --scope ...`424. Check limit: `az quota show --resource-name {name} --scope ...`435. Calculate: Available = Limit - Current Usage446. If exceeded: Request increase via `az quota update`4546**Unsupported Providers** (BadRequest error):4748Not all providers support quota API. If `az quota list` fails with BadRequest, use fallback:49501. Get current usage:51```bash52# Option A: Azure Resource Graph (recommended)53az extension add --name resource-graph54az graph query -q "resources | where type == '{type}' and location == '{loc}' | count"5556# Option B: Resource list57az resource list --subscription "{id}" --resource-type "{Type}" --location "{loc}" | jq 'length'58```592. Get limit from [service documentation](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits)603. Calculate: Available = Documented Limit - Current Usage6162**Known Support Status**:63- ❌ Microsoft.DocumentDB (Cosmos DB)64- ✅ Microsoft.Compute, Microsoft.Network, Microsoft.App, Microsoft.Storage, Microsoft.MachineLearningServices6566## Workflow6768**Phase 1: Identify & Check Hard Limits**691. Analyze app requirements and select Azure services702. Determine resource counts, sizes, tiers, throughput713. Check hard limits via azure-provisioning-limit skill or documentation724. Validate plan against limits; redesign if needed7374**Phase 2: Check Quotas After Region Selection**751. Get customer subscription and region preference762. For each service/region, check quota:77- Use `az quota usage list` and `az quota show`78- Calculate available capacity793. If quota exceeded: request increase or choose different region8081**Phase 3: Validate Region**82- Confirm sufficient quota in selected region83- Request increases if needed84- Only proceed after validation complete8586## Limit Scopes8788| Scope | Example |89|-------|---------|90| Subscription | 50 Cosmos DB accounts (any region) |91| Regional | 250 storage accounts per region |92| Resource | 500 apps per Container Apps environment |9394## Service Patterns9596| Service | Hard Limits (examples) | Quota Check | Notes |97|---------|------------------------|-------------|-------|98| **Cosmos DB** | Item: 2MB, Partition key: 2KB, Serverless storage: 50GB | ❌ Not supported. Use Resource Graph + [docs](https://learn.microsoft.com/en-us/azure/cosmos-db/concepts-limits). Default: 50 accounts/region | Query: `az graph query -q "resources \| where type == 'microsoft.documentdb/databaseaccounts' and location == 'eastus' \| count"` |99| **AKS** | Pods/node (Azure CNI): 250, Node pools/cluster: 100 | ✅ `az quota` supported | Provider: Microsoft.ContainerService |100| **Storage** | Block blob: 190.7 TiB, Page blob: 8 TiB | ✅ Quota: `StorageAccounts` (limit: 250/region) | Provider: Microsoft.Storage |101| **Container Apps** | Revisions/app: 100, HTTP timeout: 240s | ✅ Quota: `ManagedEnvironmentCount` (limit: 50/region) | Provider: Microsoft.App |102| **Functions** | Timeout (Consumption): 10 min, Queue msg: 64KB | ✅ Check function apps quota | Provider: Microsoft.Web |103104## CLI Reference105106**Prerequisites**: `az extension add --name quota`107108**Discovery**: List quotas to find resource names109```bash110az quota list --scope /subscriptions/{id}/providers/{provider}/locations/{location}111```112113**Check Usage**:114```bash115az quota usage show --resource-name {quota-name} --scope /subscriptions/{id}/providers/{provider}/locations/{location}116```117118**Check Limit**:119```bash120az quota show --resource-name {quota-name} --scope /subscriptions/{id}/providers/{provider}/locations/{location}121```122123**Request Increase**:124```bash125az quota update --resource-name {quota-name} --scope /subscriptions/{id}/providers/{provider}/locations/{location} --limit-object value={new-limit} --resource-type {type}126```127128## azure-prepare Integration129130**When to Check**:1311. After selecting services - Check hard limits1322. After customer selects region - Check quotas1333. Before generating infrastructure code - Validate availability134135**Required Steps**:136137**Phase 1 - Planning**:138- Select Azure services139- Check hard limits (service documentation)140- Create provisioning limit checklist (leave quota columns as "_TBD_")141142**Phase 2 - Execution**:143- Get subscription and region preference144- **Must invoke azure-quotas skill** - Process ONE resource type at a time:145a. Try `az quota list` first (required)146b. If supported: Use `az quota usage show` and `az quota show`147c. If NOT supported (BadRequest): Use Resource Graph + service docs148d. Calculate available capacity149e. Document in checklist (no "_TBD_" entries allowed)150f. If insufficient: Request increase or change region151152**Phase 3 - Generate Artifacts**:153- Only proceed after Phase 2 complete (all quotas validated)154155## Error Messages156157| Error | Type | Action |158|-------|------|--------|159| "Quota exceeded" | Quota | Use azure-quotas to request increase |160| "(BadRequest) Bad request" | Unsupported provider | Use [service limits docs](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits) |161| "Limit exceeded" | Hard Limit | Redesign or change tier |162| "Maximum size exceeded" | Hard Limit | Split data or use alternative storage |163| "Too many requests" | Rate Limit | Implement retry logic or increase tier |164| "Cannot exceed X" | Hard Limit | Stay within limit or use multiple resources |165| "Subscription limit reached" | Quota | Request quota increase using azure-quotas skill |166| "Regional capacity" | Quota | Choose different region or request increase |167168## Best Practices1691701. **MUST use Azure CLI quota API first**: `az quota` commands are MANDATORY as the primary method for checking quotas - only use fallback methods (REST API, Portal, docs) when quota API returns `BadRequest`1712. **Don't trust "No Limit" values**: If REST API or Portal shows "No Limit" or unlimited, verify with official service documentation - it likely means the quota API doesn't support that resource type, not that capacity is unlimited1723. **Always check after customer selects region**: Validates availability and allows time for quota requests1734. **Use the discovery workflow**: Never assume quota resource names - always run `az quota list` first to discover correct names1745. **Check both usage and limit**: Run `az quota usage show` AND `az quota show` to calculate available capacity1756. **Handle unsupported providers gracefully**: If you get `BadRequest` error, fall back to official documentation (Azure Resource Graph + docs)1767. **Request quota increases proactively**: If selected region lacks capacity, submit request before deployment1778. **Have alternative regions ready**: If quota increase denied, suggest backup regions1789. **Document capacity assumptions**: Note quota availability and source in `.azure/deployment-plan.md`17910. **Design for limits**: Architecture should account for both hard limits and quotas18011. **Monitor usage trends**: Regular quota checks help predict future needs18112. **Use lower environments wisely**: Dev/test environments count against quotas182183## Quick Reference Limits184185For complete quota checking workflow and commands, invoke the **azure-quotas** skill.186187> **Note:** These are typical default limits. Always verify actual quotas using `az quota show` for your specific subscription and region.188189Common quotas to check:190191### Subscription Level192- Cosmos DB accounts: 50 per region (check via docs - quota API not supported)193- SQL logical servers: 250 per region194- Service Bus namespaces: 100-1,000 (tier dependent)195196### Regional Level197- Storage accounts: 250 per region (quota resource name: `StorageAccounts`)198- AKS clusters: 5,000 per region (quota resource name: varies by configuration)199- Container Apps environments: 50 per region (quota resource name: `ManagedEnvironmentCount`)200- Function apps: 200 per region (Consumption)201202### Resource Level203- Cosmos DB containers per account: Unlimited (subject to storage)204- Apps per Container Apps environment: 500205- Databases per SQL server: 500206- Queues/topics per Service Bus namespace: 10,000207208## Related Documentation209210- **azure-quotas skill** - Complete quota checking workflow and CLI commands (invoke the **azure-quotas** skill)211- [Azure subscription limits](https://learn.microsoft.com/azure/azure-resource-manager/management/azure-subscription-service-limits) - Official Microsoft documentation212- [Azure Quotas Overview](https://learn.microsoft.com/en-us/azure/quotas/quotas-overview) - Understanding quotas and limits213- [azure-context.md](azure-context.md) - How to confirm subscription and region214- [architecture.md](architecture.md) - Architecture planning workflow215216## Example: Complete Check Workflow217218```bash219# Scenario: Deploying app with Cosmos DB, Storage, and Container Apps220# Customer selected region: East US221222# 1. Check Hard Limits (from azure-provisioning-limit skill)223# Cosmos DB: Item size max 2 MB ✓224# Storage: Blob size max 190.7 TiB ✓225# Container Apps: Timeout 240 sec ✓226227# 2. Get Customer's Region Preference228# Customer: "I prefer East US"229230# 3. Check Quotas for Customer's Selected Region (East US)231232# 3a. Cosmos DB - NOT SUPPORTED by quota API233az quota list \234--scope /subscriptions/abc-123/providers/Microsoft.DocumentDB/locations/eastus235# Error: (BadRequest) Bad request236237# Fallback: Get current usage with Azure Resource Graph238# Install extension first (if needed)239az extension add --name resource-graph240241az graph query -q "resources | where type == 'microsoft.documentdb/databaseaccounts' and location == 'eastus' | count"242# Result: 3 database accounts currently deployed243244# Or use Azure CLI resource list245az resource list \246--subscription "abc-123" \247--resource-type "Microsoft.DocumentDB/databaseAccounts" \248--location "eastus" | jq 'length'249# Result: 3250251# Get limit from documentation: 50 database accounts per region252# Calculate: Available = 50 - 3 = 47 ✓253# Document as: "Fetched from: Azure Resource Graph + Official docs"254255# 3b. Storage Accounts256# Step 1: Discover resource name257az quota list \258--scope /subscriptions/abc-123/providers/Microsoft.Storage/locations/eastus259260# Step 2: Check usage (use discovered name "StorageAccounts")261az quota usage show \262--resource-name StorageAccounts \263--scope /subscriptions/abc-123/providers/Microsoft.Storage/locations/eastus264# Current: 180265266# Step 3: Check limit267az quota show \268--resource-name StorageAccounts \269--scope /subscriptions/abc-123/providers/Microsoft.Storage/locations/eastus270# Limit: 250271# Available: 250 - 180 = 70 ✓272273# 3c. Container Apps274# Step 1: Discover resource name275az quota list \276--scope /subscriptions/abc-123/providers/Microsoft.App/locations/eastus277# Shows: "ManagedEnvironmentCount"278279# Step 2: Check usage280az quota usage show \281--resource-name ManagedEnvironmentCount \282--scope /subscriptions/abc-123/providers/Microsoft.App/locations/eastus283# Current: 8284285# Step 3: Check limit286az quota show \287--resource-name ManagedEnvironmentCount \288--scope /subscriptions/abc-123/providers/Microsoft.App/locations/eastus289# Limit: 50290# Available: 50 - 8 = 42 ✓291292# 4. Validate Availability293# ✅ All services have sufficient quota in East US294# ✅ Proceed with deployment295296# Alternative: If quotas were insufficient297# ❌ Container Apps: 49/50 (only 1 available, need 3)298# Action: Request quota increase299#300# az quota update \301# --resource-name ManagedEnvironmentCount \302# --scope /subscriptions/abc-123/providers/Microsoft.App/locations/eastus \303# --limit-object value=100 \304# --resource-type Microsoft.App/managedEnvironments305```306307---308309> **Remember**: Checking limits and quotas early prevents deployment failures and ensures smooth infrastructure provisioning.310