Find SKUs and Images available in Azure RM

If you’ve landed here, odds are you are trying to find the SKUs or images available for your Microsoft Azure subscription and have already hit multiple pages referencing the outdated Get-AzureVMImage command. Things change quickly in the cloud and old data seems to linger for a while.

But have no fear. The information below outlines the commands to get the details on the Azure publisher, offer name, SKU Name and list all the VM images available based on location and subscription.

To find the needed information, first set the location; Central US in this example. Use the command below to find the location name if needed.

Get-AzureRmLocation | Select Location,DisplayName
$locName = "centralus"

Get-AzureRmLocation Get Location

Next, I’ll run the command below to get the Publisher Names in the region I specified as the locName varialbl. This will be filtered to Windows publications only.

Get-AzureRmVMImagePublisher -Location $locName | where-object {$_.PublisherName -like "*windows*"} | ft PublisherName,Location

Get-AzureRmVMImagePublisher Get Publisher

With that information, I’ll set my publisher name to Micorosft Windows Server

$pubName="MicrosoftWindowsServer"

Next, I list all the images offered by the Microsoft Windows Server publication with the command below.

Get-AzureRmVMImageOffer -Location $locName -PublisherName $pubName | ft Offer,PublisherName,Location

Get-AzureRmVMImageOffer Get Offer

Based on the output from that command, I set the Image Offer to Windows Server

$offerName="WindowsServer"

After that, I run the following command to list the images available for the offer

Get-AzureRmVMImageSku -Location $locName -PublisherName $pubName -Offer $offerName | ft Skus,Offer,PublisherName,Location

Get-AzureRmVMImageSku Get image SKU

And set the Sku to 2016-Datacenter

$skuName="2012-R2-Datacenter"

Lastly, use this command to list the images available for the SKU

Get-AzureRmVMImage -Location $locName -PublisherName $pubName -Skus $skuName -Offer $offerName

Get-AzureRmVMImage Get SKU Image

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.