When delivering courses I continually have a battle with the ever changing resources available in the ever changing location availability with Azure Passes.

I use the following command to combat this (usually one day 1):

Login to Azure using Login-AzureRMAccount or Add-AzureRMAccount depending on PS Version.  Then run the following command:

$resources = Get-AzureRmResourceProvider -ProviderNamespace Microsoft.Compute
$resources.ResourceTypes.Where{($_.ResourceTypeName -eq ‘virtualMachines’)}.Locations

This shows the available regions for the subscription. 

(Note:  This is not an Azure Pass i am using for this blog so there are more than normal)

image

Now run the following command to see which VM sizes are available for a particular region you wish to use. 

(Change the Location to your preferred option)

Get-AzureRmVmSize -Location “UK South” | Sort-Object Name | ft Name, NumberOfCores, MemoryInMB, MaxDataDiskCount –AutoSize

image

If you use the Azure CLI then then use this equivalent command:

az provider show –namespace Microsoft.Compute –query “resourceTypes[?resourceType==’virtualMachines’].locations | [0]” –out tsv

(Thanks to Sydney Andrews for this command)

This should make life a little easier.