Photo by Manuel Sardo on Unsplash

How to Find Azure Windows VM Images for Terraform or Packer Deployments

Guillermo Musumeci
4 min readApr 6, 2020

When we need to deploy Windows virtual machines using Terraform or if we need to create a Packer image in Azure, we will need to find the image information of the operating system.

The information required to deploy a Windows virtual machine is:

  • Publisher: The organization that created the image. Examples: MicrosoftWindowsServer, MicrosoftWindowsDesktop
  • Offer: The name of a group of related images created by a publisher. Examples: WindowsServer, Windows-10
  • SKU: An instance of an offer, such as a major release of a distribution. Examples: 2019-Datacenter, 19h2-pro-g2
  • Version: The version number of an image SKU.

This story will help you to find Windows images. If you want to list Linux images check

1. Listing Image Publishers:

We open our Azure Cloud Shell (PowerShell) or Azure PowerShell CLI.

Login into Azure:


The process starts by defining our Azure region using a variable:

$location = "West Europe"

Then we will use Get-AzVMImagePublisher to list all publishers:

Get-AzVMImagePublisher -Location $location | Select PublisherName

Optionally, we can export the result to a text file to explore the list in detail (I’m pretty sure you will be surprised by the result, and you want to explore a little bit more 😄):

Get-AzVMImagePublisher -Location $location | Select PublisherName | Out-File -FilePath AzurePublisherList.txt

If we need to search for Windows images, we can use a Filter:

Get-AzVMImagePublisher -Location $location | Select PublisherName | Where-Object { $_.PublisherName -like '*Windows*' }
Filtering of Windows Publishers

2. Listing Image Offers:

Guillermo Musumeci

Certified AWS, Azure & GCP Architect | HashiCorp Ambassador | Terraform SME | KopiCloud Founder | ex-AWS | Entrepreneur | Book Author | Husband & Dad of ✌