azure

How to get a list of available vm sizes in an azure location


I want to deploy a VM in microsoft's azure with a new size. Usually I use a json template for the vm with size 'Standard_DS3' Now I would like to have another one with size a3 'A3', but this causes an error

statusMessage:{"error":{"code":"InvalidParameter","target":"vmSize","message":"The value of parameter vmSize is invalid."}}

So I was wondering where can I find valid vm sizes for deployments in a location and the correct name for the deployment with a template file?


Solution

  • Since you mentioned json templates in your question then I assume that you are using Azure Resource Manager to provision resources. If that's the case, you can use the following REST API endpoint to list all available virtual machine sizes in a region.

    https://management.azure.com/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/{location}/vmSizes?api-version={api-version}
    

    This information is accessible using Azure CLI, i.e.: az vm list-sizes --location "eastus"

    You can also reference Microsoft documentation to see the list of virtual machine sizes. Sounds like you need to use the "Large" size in your template to provision an A3 Standard VM.