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.
  • If you're deploying an Azure Spot VM or Spot scale set instance, and there isn't any capacity for Azure Spot in this location. For more information, see Spot error messages.

Solution

If a SKU isn't available for your subscription in a location or zone that meets your business needs, submit a SKU request to Azure Support.

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

az vm list-skus --location centralus --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  centralus    Standard_D1        1        None
virtualMachines  centralus    Standard_D11       1        None
virtualMachines  centralus    Standard_D11_v2    1,2,3    None
virtualMachines  centralus    Standard_D16ds_v4  1,2,3    NotAvailableForSubscription, type: Zone,
                                                          locations: centralus, zones: 1,2,3

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 centralus --zone --all --output table
ResourceType      Locations    Name                 Zones    Restrictions
----------------  -----------  -------------------  -------  --------------
disks             centralus    Premium_LRS          1,2,3    None
disks             centralus    Premium_LRS          1,2,3    None
virtualMachines   centralus    Standard_A2_v2       1,2,3    None
virtualMachines   centralus    Standard_D16ds_v4    1,2,3    NotAvailableForSubscription, type: Zone,
                                                             locations: centralus, zones: 1,2,3

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

az vm list-skus --location centralus --resource-type virtualMachines --zone --all --output table
ResourceType      Locations    Name                 Zones    Restrictions
----------------  -----------  -------------------  -------  --------------
virtualMachines   centralus    Standard_A1_v2       1,2,3    None
virtualMachines   centralus    Standard_A2m_v2      1,2,3    None
virtualMachines   centralus    Standard_A2_v2       1,2,3    None
virtualMachines   centralus    Standard_D16ds_v4    1,2,3    NotAvailableForSubscription, type: Zone,
                                                             locations: centralus, zones: 1,2,3