Problem
Quota and capacity errors account for ~3,605 errors (2.82%) over 90 days. Users deploy templates, wait for provisioning, then fail with InsufficientQuota, SkuNotAvailable, or LocationIsOfferRestricted. These failures are predictable and could be caught before deployment begins.
Current Behavior
azd has excellent quota pre-checks for AI model deployments in pkg/ai/model_service.go (ResolveModelDeploymentsWithQuota(), ListLocationsWithQuota(), FilterModelsByQuota()). However, standard ARM provisioning in pkg/infra/provisioning/bicep/bicep_provider.go has no quota pre-checks.
azd already runs ARM preflight validation (ValidatePreflightToResourceGroup()) and what-if preview before deployment, but these do not check subscription quota.
Proposed Solution
- After the what-if preview step, parse the output to identify resource types being created (VMs, Cognitive Services, OpenAI, etc.)
- For high-quota-failure resource types, query the ARM quota/usage APIs:
Microsoft.Compute/locations/{location}/usages for VM SKUs
Microsoft.CognitiveServices quota endpoints for AI resources
- Compare required capacity against remaining quota
- If quota is insufficient, warn the user before deploying:
Warning: Your subscription has N of M vCPUs remaining in <region>. This deployment requires K vCPUs. Consider changing region with 'azd env set AZURE_LOCATION <region>' or requesting a quota increase.
- Consider the AI model quota system in
pkg/ai/model_service.go as an architectural reference for this feature
Data Reference
Source: AzdProvisionErrorsByTemplate + AzdDeploymentErrorsByTemplate (DevCli on ddazureclients)
- Quota / Capacity errors: 3,605 (2.82%)
- AI templates: 3.12%, Awesome-azd: 2.26%
- Key ARM codes:
InsufficientQuota, SubscriptionIsOverQuotaForSku, SkuNotAvailable, LocationIsOfferRestricted, DeploymentModelNotSupported
Problem
Quota and capacity errors account for ~3,605 errors (2.82%) over 90 days. Users deploy templates, wait for provisioning, then fail with
InsufficientQuota,SkuNotAvailable, orLocationIsOfferRestricted. These failures are predictable and could be caught before deployment begins.Current Behavior
azd has excellent quota pre-checks for AI model deployments in
pkg/ai/model_service.go(ResolveModelDeploymentsWithQuota(),ListLocationsWithQuota(),FilterModelsByQuota()). However, standard ARM provisioning inpkg/infra/provisioning/bicep/bicep_provider.gohas no quota pre-checks.azd already runs ARM preflight validation (
ValidatePreflightToResourceGroup()) and what-if preview before deployment, but these do not check subscription quota.Proposed Solution
Microsoft.Compute/locations/{location}/usagesfor VM SKUsMicrosoft.CognitiveServicesquota endpoints for AI resourcesWarning: Your subscription has N of M vCPUs remaining in <region>. This deployment requires K vCPUs. Consider changing region with 'azd env set AZURE_LOCATION <region>' or requesting a quota increase.pkg/ai/model_service.goas an architectural reference for this featureData Reference
Source: AzdProvisionErrorsByTemplate + AzdDeploymentErrorsByTemplate (DevCli on ddazureclients)
InsufficientQuota,SubscriptionIsOverQuotaForSku,SkuNotAvailable,LocationIsOfferRestricted,DeploymentModelNotSupported