How to find Windows VM images in the Azure Marketplace with Azure PowerShell

This topic describes how to use Azure PowerShell to find VM images in the Azure Marketplace. Use this information to specify a Marketplace image when you create a Windows VM.

Make sure that you installed and configured the latest Azure PowerShell module.

Table of commonly used Windows images

PublisherName Offer Sku
MicrosoftWindowsServer WindowsServer 2016-Datacenter
MicrosoftWindowsServer WindowsServer 2016-Datacenter-Server-Core
MicrosoftWindowsServer WindowsServer 2016-Datacenter-with-Containers
MicrosoftWindowsServer WindowsServer 2016-Nano-Server
MicrosoftWindowsServer WindowsServer 2012-R2-Datacenter
MicrosoftWindowsServer WindowsServer 2008-R2-SP1
MicrosoftDynamicsNAV DynamicsNAV 2017
MicrosoftSharePoint MicrosoftSharePointServer 2016
MicrosoftSQLServer SQL2016-WS2016 Enterprise
MicrosoftSQLServer SQL2014SP2-WS2012R2 Enterprise
MicrosoftWindowsServerHPCPack WindowsServerHPCPack 2012R2
MicrosoftWindowsServerEssentials WindowsServerEssentials WindowsServerEssentials

Find specific images

When creating a new virtual machine with Azure Resource Manager, in some cases you need to specify an image with the combination of the following image properties:

  • Publisher
  • Offer
  • SKU

For example, use these values with the Set-AzureRMVMSourceImage PowerShell cmdlet, or with a resource group template in which you must specify the type of VM to be created.

If you need to determine these values, you can run the Get-AzureRMVMImagePublisher, Get-AzureRMVMImageOffer, and Get-AzureRMVMImageSku cmdlets to navigate the images. You determine these values:

  1. List the image publishers.
  2. For a given publisher, list their offers.
  3. For a given offer, list their SKUs.

First, list the publishers with the following commands:

$locName="<Azure location, such as West US>"
Get-AzureRMVMImagePublisher -Location $locName | Select PublisherName

Fill in your chosen publisher name and run the following commands:

$pubName="<publisher>"
Get-AzureRMVMImageOffer -Location $locName -Publisher $pubName | Select Offer

Fill in your chosen offer name and run the following commands:

$offerName="<offer>"
Get-AzureRMVMImageSku -Location $locName -Publisher $pubName -Offer $offerName | Select Skus

From the output of the Get-AzureRMVMImageSku command, you have all the information you need to specify the image for a new virtual machine.

The following shows a full example:

$locName="West US"
Get-AzureRMVMImagePublisher -Location $locName | Select PublisherName

Output:

PublisherName
-------------
a10networks
aiscaler-cache-control-ddos-and-url-rewriting-
alertlogic
AlertLogic.Extension
Barracuda.Azure.ConnectivityAgent
barracudanetworks
basho
boxless
bssw
Canonical
...

For the "MicrosoftWindowsServer" publisher:

$pubName="MicrosoftWindowsServer"
Get-AzureRMVMImageOffer -Location $locName -Publisher $pubName | Select Offer

Output:

Offer
-----
Windows-HUB
WindowsServer
WindowsServer-HUB

For the "WindowsServer" offer:

$offerName="WindowsServer"
Get-AzureRMVMImageSku -Location $locName -Publisher $pubName -Offer $offerName | Select Skus

Output:

Skus
----
2008-R2-SP1
2008-R2-SP1-smalldisk
2012-Datacenter
2012-Datacenter-smalldisk
2012-R2-Datacenter
2012-R2-Datacenter-smalldisk
2016-Datacenter
2016-Datacenter-Server-Core
2016-Datacenter-Server-Core-smalldisk
2016-Datacenter-smalldisk
2016-Datacenter-with-Containers
2016-Nano-Server

From this list, copy the chosen SKU name, and you have all the information for the Set-AzureRMVMSourceImage PowerShell cmdlet or for a resource group template.

Next steps

Now you can choose precisely the image you want to use. To create a virtual machine quickly by using the image information, which you just found, see Create a Windows virtual machine with PowerShell.