Understanding Azure Resource SKU restriction reason codes

lzap 56 Reputation points
2022-09-07T06:43:50.037+00:00

Hello,

I am using the SKU REST API (https://learn.microsoft.com/en-us/rest/api/compute/resource-skus/list?tabs=HTTP) to query available VM sizes for each region and I do not understand ResourceSkuRestrictionsReasonCode. There are two codes: NotAvailableForSubscription and QuotaId.

Now, for NotAvailableForSubscription I see many deprecated sizes listed which makes perfect sense, but I also do see some sizes to disappear/reapper from time to time when I do multiple requests and I wonder if this reason code is also used when capacity for such VM size is reached.

The problem is, I want to get full list of all possible (not deprecated) VM sizes, I am not interested in what the actual capacity is and I believe this REST API is the right one to use. Can someone explain me this flag?

The second code, QuotaId, is also a bit weird. From the name, it looks like it should restrict VM sizes my account don't have quotas for, however, on my account I only have basic quotas, yet I see all of the VM sizes. I have literally zero quota restrictions.

The documentation is not really good for this REST API, I hope to find more information somewhere. Thanks!

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,045 questions
0 comments No comments
{count} vote

Accepted answer
  1. kobulloc-MSFT 26,811 Reputation points Microsoft Employee Moderator
    2022-09-09T02:00:07.077+00:00

    Hello, @lzap !

    What does NotAvailableForSubscription mean? How do I get a full list of all possible VM sizes?
    I'm pretty familiar with NotAvailableForSubscription and I'll give you a run down of possible causes as it covers quite a few scenarios.
    The bad (or possibly good) news is you're using the best command available for the REST API that I'm familiar with as this is the command you'll see given in the documentation. I'll give you an Azure CLI equivalent for Resource Skus - List that may get you what you are looking for.

    NotAvailableForSubscription
    Currently, the most common reason for running into this is VM availability as described in the Microsoft Q&A sticky thread. This would explain why you would see sizes appear and disappear but there are a number of other reasons one might see this as well:

    • There are no more of those VM SKUs available for your subscription in that region (see the Microsoft Q&A sticky for additional information)
    • You have hit your core limit for that region (and need to increase your available quota)
    • You are unable to create VMs in that region due to a policy created by your admin
    • The VM size you are trying to use is not available for your subscription (free/student accounts, for example)
    • The specific VM SKU you are trying to create has not been enabled for your subscription (you need to open a support ticket to enable that SKU)
    • You are trying to deploy an Azure Spot VM or Spot scale set instance and there isn't additional capacity at that location

    I'd offer to give more insight into QuotaId but while I do see NotAvailableForSubscription as a restriction on some VMs on my subscription, I do not see QuotaId and like you I haven't been able to find much in the way of documentation online.

    How do I get a full list of VM sizes?
    To list all SKUs available in a region, you would use the az vm list-skus command (which does incorporate subscription level restrictions) or az vm list-sizes as an equivalent to the Resource Skus - List REST command. Here, I've used az vm list-sizes. I hope this helps!

    az vm list-sizes -l westus -o table  
    

    239293-image.png

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.