Resolve errors for SKU not available

This article describes how to resolve errors when a SKU isn't available in an Azure subscription's region or availability zones. Examples of resource SKUs are virtual machine (VM) size or storage account types. Errors occur during deployments with an Azure Resource Manager template (ARM template) or Bicep file. The error also occurs with commands like New-AzVM or az vm create that specify a size parameter for a SKU that's not available.

Symptom

When a VM is deployed for a SKU that's not available, an error occurs. Azure CLI and Azure PowerShell deployment commands display an error message that the requested size isn't available in the location or zone. In the Azure portal activity log, you'll see error codes SkuNotAvailable or InvalidTemplateDeployment.

In this example, New-AzVM specified the -Size parameter for a SKU that's not available. The error code SkuNotAvailable is shown in the portal's activity log.

The requested size for resource '<resource ID>' is currently not available in location '<location>'
zones '<zones>' for subscription '<subscription ID>'.
Please try another size or deploy to a different location or zones.

When a VM is deployed with an ARM template or Bicep file for a SKU that's not available, a validation error occurs. The error code InvalidTemplateDeployment and error message are displayed. The deployment doesn't start so there's no deployment history, but the error is in the portal's activity log.

Error: Code=InvalidTemplateDeployment
Message=The template deployment failed with error: The resource with id: '<resource ID>' failed validation
with message: The requested size for resource '<resource ID>' is currently not available in
location '<location>' zones '<zones>' for subscription '<subscription ID>'.
Please try another size or deploy to a different location or zones.

Cause

You receive this error in the following scenarios:

  • When the resource SKU you've selected, such as VM size, isn't available for a location or zone.

Solution

To determine which SKUs are available in a location or zone, use the az vm list-skus command.

az vm list-skus --location chinanorth3 --size Standard_D --all --output table
  • --location filters output by location.
  • --size searches by a partial size name.
  • --all shows all information and includes sizes that aren't available for the current subscription.
ResourceType     Locations    Name               Zones    Restrictions
---------------  -----------  --------------     -------  --------------
virtualMachines  ChinaNorth3  Standard_D11_v2         1,2,3    None
virtualMachines  ChinaNorth3  Standard_D11_v2_Promo   1,2,3    None
virtualMachines  ChinaNorth3  Standard_D12_v2         1,2,3    None
virtualMachines  ChinaNorth3  Standard_D12_v2_Promo   1,2,3    None
virtualMachines  ChinaNorth3  Standard_D13_v2         1,2,3    None

Availability zones

You can view all the compute resources for a location's availability zones. By default, only SKUs without restrictions are displayed. To include SKUs with restrictions, use the --all parameter.

az vm list-skus --location chinanorth3 --zone --all --output table
ResourceType      Locations    Name                 Zones    Restrictions
----------------  -----------  -------------------  -------  --------------
disks             chinanorth3  Premium_LRS             1,2,3    None
disks             chinanorth3  Premium_LRS             1,2,3    None
disks             chinanorth3  Premium_LRS             1,2,3    None
disks             chinanorth3  Premium_LRS             1,2,3    None
disks             chinanorth3  Premium_LRS             1,2,3    None

You can filter by a resourceType like VMs for availability zones.

az vm list-skus --location chinanorth3 --resource-type virtualMachines --zone --all --output table
ResourceType      Locations    Name                 Zones    Restrictions
----------------  -----------  -------------------  -------  --------------
virtualMachines  ChinaNorth3  Standard_A1_v2          1,2,3    None
virtualMachines  ChinaNorth3  Standard_A2m_v2         1,2,3    None
virtualMachines  ChinaNorth3  Standard_A2_v2          1,2,3    None
virtualMachines  ChinaNorth3  Standard_A4m_v2         1,2,3    None
virtualMachines  ChinaNorth3  Standard_A4_v2          1,2,3    None