In my previous post, I described how to retrieve a list of available VM sizes and images from Azure using PowerShell. I’ve written two scripts which do exactly that. The scripts allow you to create an availability matrix containing either a list of VM sizes or a list of VM images you can use to deploy your IaaS VMs.
These 2 scripts will output to a CSV file which can be imported in Excel to do filtering. This gives you an easy overview on which VM images are available in which Azure locations. The same goes for VM sizes (eg. Basic_A0, Standard_GS1, etc.).
Usage and Output
Both scripts come with synopsis, so you can use the Get-Help cmdlet on them. In the most basic form, you will need to define the output path (filename) of the CSV file which will be generated. This will prompt you for the credentials to be used and retrieves ALL available Azure locations. For example:
If you want to do a comparison of certain Azure locations (eg. availability in West US and West Europe), you can define the -Location parameter:
Export-AzureVMImages.ps1 -Path "C:\Data\AzureImages.csv" -Location "West US 2","West Europe"
As described above, the scripts output to CSV. By default, comma is used as field separator. If you want to modify this, use the -CSVDelimiter parameter to define your preferred separator character. This parameter accepts one or more strings (separated by comma) as value. For example: