Skip to content

Latest commit

 

History

History
245 lines (187 loc) · 13.1 KB

File metadata and controls

245 lines (187 loc) · 13.1 KB
title SKU not available errors
description Describes how to troubleshoot the SKU not available error when deploying resources with an Azure Resource Manager template (ARM template) or Bicep file.
ms.topic troubleshooting
ms.custom devx-track-arm-template, devx-track-bicep
ms.date 04/28/2025

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

To determine which SKUs are available in a location or zone, use the Get-AzComputeResourceSku command.

Get-AzComputeResourceSku | Where-Object { $_.Locations -contains "centralus" }

The Get-AzComputeResourceSku cmdlet gets all the compute resources. The objects are sent down the pipeline and Where-Object filters the output to include only the specified location. SKUs that aren't available for the current subscription are listed as NotAvailableForSubscription.

ResourceType                       Name  Location      Zones                  Restriction            Capability    Value
------------                       ----  --------      -----                  -----------            ----------    -----
disks                       Premium_LRS centralus   {1, 3, 2}                                        MaxSizeGiB        4
disks                       Premium_LRS centralus   {1, 3, 2}                                        MaxSizeGiB      128
virtualMachines             Standard_A1 centralus                                           MaxResourceVolumeMB    71680
virtualMachines          Standard_A1_v2 centralus   {1, 2, 3}                               MaxResourceVolumeMB    10240
virtualMachines       Standard_D16ds_v4 centralus   {1, 3, 2}  NotAvailableForSubscription  MaxResourceVolumeMB   614400

The following PowerShell script filters by location and SKU:

$SubId = (Get-AzContext).Subscription.Id

$Region = "centralus" # change region here
$VMSku = "Standard_D" # change VM SKU here

$VMSKUs = Get-AzComputeResourceSku | where {$_.Locations.Contains($Region) -and $_.ResourceType.Contains("virtualMachines") -and $_.Name.Contains($VMSku)}

$OutTable = @()

foreach ($SkuName in $VMSKUs.Name)
        {
            $LocRestriction = if ((($VMSKUs | where Name -EQ $SkuName).Restrictions.Type | Out-String).Contains("Location")){"NotAvailableInRegion"}else{"Available - No region restrictions applied" }
            $ZoneRestriction = if ((($VMSKUs | where Name -EQ $SkuName).Restrictions.Type | Out-String).Contains("Zone")){"NotAvailableInZone: "+(((($VMSKUs | where Name -EQ $SkuName).Restrictions.RestrictionInfo.Zones)| Where-Object {$_}) -join ",")}else{"Available - No zone restrictions applied"}


            $OutTable += New-Object PSObject -Property @{
                                                         "Name" = $SkuName
                                                         "Location" = $Region
                                                         "Applies to SubscriptionID" = $SubId
                                                         "Subscription Restriction" = $LocRestriction
                                                         "Zone Restriction" = $ZoneRestriction
                                                         }
         }

$OutTable | select Name, Location, "Applies to SubscriptionID", "Subscription Restriction", "Zone Restriction" | Sort-Object -Property Name | Format-Table

Name                   Location  Applies to SubscriptionID              Subscription Restriction                     Zone Restriction
----                   --------  -------------------------              ------------------------                     ----------------
Standard_D1            centralus 11111111-1111-1111-1111-111111111111   Available - No region restrictions applied   Available - No zone restrictions applied
Standard_D1_v2         centralus 11111111-1111-1111-1111-111111111111   Available - No region restrictions applied   Available - No zone restrictions applied
Standard_D16d_v4       centralus 11111111-1111-1111-1111-111111111111   Available - No region restrictions applied   NotAvailableInZone: 1,2,3
Standard_D16d_v5       centralus 11111111-1111-1111-1111-111111111111   Available - No region restrictions applied   Available - No zone restrictions applied
Standard_D16ds_v4      centralus 11111111-1111-1111-1111-111111111111   Available - No region restrictions applied   NotAvailableInZone: 1,2,3
Standard_D16ds_v5      centralus 11111111-1111-1111-1111-111111111111   Available - No region restrictions applied   Available - No zone restrictions applied

Availability zones

The following command only shows VM sizes for availability zones. SKUs that aren't available for the current subscription are listed as NotAvailableForSubscription.

Get-AzComputeResourceSku | Where-Object { $_.Locations -contains "centralus" -and $_.LocationInfo.Zones -ne $null -and $_.ResourceType -eq "virtualmachines" }
ResourceType                 Name   Location      Zones                 Restriction           Capability    Value
------------                 ----   --------      -----                 -----------           ----------    -----
virtualMachines     Standard_A1_v2  centralus {1, 2, 3}                              MaxResourceVolumeMB    10240
virtualMachines    Standard_A2m_v2  centralus {1, 2, 3}                              MaxResourceVolumeMB    20480
virtualMachines     Standard_A2_v2  centralus {1, 2, 3}                              MaxResourceVolumeMB    20480
virtualMachines  Standard_D16ds_v4  centralus {1, 3, 2} NotAvailableForSubscription  MaxResourceVolumeMB   614400

To determine which SKUs are available in a Region, use the portal. Sign in to the portal, and create a VM resource. You can select a Size with the drop-down menu of the available SKUs. You don't need to complete the deployment.

  • To see other available sizes, select See all sizes.

    :::image type="content" source="media/error-sku-not-available/create-vm.png" alt-text="Screenshot of Azure portal deployment interface displaying options to select a virtual machine size from a drop-down menu.":::

  • You can filter and scroll through the available sizes. When you find the VM size you want to use, choose Select.

    :::image type="content" source="media/error-sku-not-available/available-sizes.png" alt-text="Screenshot of Azure portal showing a list of available virtual machine sizes along with filtering options to narrow down the selection.":::

To determine which SKUs are available in a location, use the Resource Skus - List operation.

You can use az rest to run the list operation. Replace <subscription ID> including the angle brackets with your subscription ID. The output is a large data set that you can save to a JSON file.

az rest --method get --uri https://management.azure.com/subscriptions/<subscription ID>/providers/Microsoft.Compute/skus?api-version=2021-07-01 --output-file .\sku-list.json

The command returns available SKUs and locations in JSON format:

{
  "resourceType": "virtualMachines",
  "name": "Standard_A1_v2",
  "tier": "Standard",
  "size": "A1_v2",
  "family": "standardAv2Family",
  "locations": [
    "centralus"
  ],
  "locationInfo": [
    {
      "location": "centralus",
      "zones": [
        "1",
        "2",
        "3"
      ],
      "zoneDetails": []
    }
  ],
  "capabilities": [
    {
      "name": "MaxResourceVolumeMB",
      "value": "10240"
    },
    {
      "name": "OSVhdSizeMB",
      "value": "1047552"
    },
    {
      "name": "vCPUs",
      "value": "1"
    }
  ],
  "restrictions": []
}

Sometimes, a size (SKU) shows as available in the Azure portal or via CLI commands, but attempts to deploy or start resources (such as Virtual Machines, VM Scale Sets, or Kubernetes clusters) result in a "SKU not available" error.