Troubleshoot LocationNotFoundForRoleSize when deploying a Cloud service to Azure

Important

Cloud Services (classic) is now deprecated for all customers as of September 1st, 2024. Any existing running deployments will be stopped and shut down by Microsoft and the data will be permanantly lost starting October 2024. New deployments should use the new Azure Resource Manager based deployment model Azure Cloud Services (extended support).

This article troubleshoots allocation failures where a virtual machine (VM) size isn't available when you deploy an Azure Cloud service (classic).

When you deploy instances to a Cloud service (classic) or add new web or worker role instances, Azure allocates compute resources.

You might receive errors during these operations even before you reach the Azure subscription limit.

Tip

The information may also be useful when you plan the deployment of your services.

Symptom

In the Azure portal, navigate to your Cloud service (classic) and in the sidebar select Operation log (classic) to view the logs.

Screenshot shows the Operation log (classic) pane.

When you inspect the logs of your Cloud service (classic), you see the following exception:

Exception Type Error Message
LocationNotFoundForRoleSize The operation '{Operation ID}' failed: 'The requested VM tier is currently not available in Region ({Region ID}) for this subscription. Please try another tier or deploy to a different location.'.

Cause

There's a capacity issue with the region or cluster that you're deploying to. The LocationNotFoundForRoleSize exception occurs when the resource SKU you selected, the virtual machine size, isn't available for the region specified.

Find SKUs in a region

In this scenario, you should select a different region or SKU for your Cloud service (classic) deployment. Before you deploy or upgrade your Cloud service (classic), determine which SKUs are available in a region or availability zone. Use the following the Azure CLI, PowerShell, or REST API processes.

List SKUs in region using Azure CLI

You can use the az vm list-skus command.

  • Use the --location parameter to filter output to location you're using.
  • Use the --size parameter to search by a partial size name.
  • For more information, see the Resolve error for SKU not available guide.

This sample command produces the following results:

az vm list-skus --location chinanorth --size Standard_F --output table

Screenshot shows the Azure CLI output of running the command, which shows the available SKUs.

List SKUs in region using PowerShell

You can use the Get-AzComputeResourceSku command.

This command filters by location:

Get-AzComputeResourceSku | where {$_.Locations -icontains "chinanorth"}

Find the locations that contain the size Standard_DS14_v2:

Get-AzComputeResourceSku | where {$_.Locations.Contains("chinanorth") -and $_.ResourceType.Contains("virtualMachines") -and $_.Name.Contains("Standard_DS14_v2")}

Find the locations that contain the size V3:

Get-AzComputeResourceSku | where {$_.Locations.Contains("chinanorth") -and $_.ResourceType.Contains("virtualMachines") -and $_.Name.Contains("v3")} | fc

List SKUs in region using REST API

You can use the Resource Skus - List operation. It returns available SKUs and regions in the following format:

{
  "value": [
    {
      "resourceType": "virtualMachines",
      "name": "Standard_A0",
      "tier": "Standard",
      "size": "A0",
      "locations": [
        "chinanorth"
      ],
      "restrictions": []
    },
    {
      "resourceType": "virtualMachines",
      "name": "Standard_A1",
      "tier": "Standard",
      "size": "A1",
      "locations": [
        "chinanorth"
      ],
      "restrictions": []
    },
      <<The rest of your file is located here>>
  ]
}
    

Next steps

For more allocation failure solutions and to better understand how allocation failures occur:

If your Azure issue isn't addressed in this article, visit the Azure forums on MSDN and Stack Overflow. You can post your issue in these forums, or post to @AzureSupport on X. You also can submit an Azure support request. To submit a support request, on the Azure support page, select Get support.