Find Azure Images by Publisher

Use AZ PowerShell module to find VM Images available by Publisher

First install the PowerShell Az Module.

On Windows, open an elevated PowerShell window and run: Install-Module -Name Az -AllowClobber

On MacOS, use sudo to open pwsh, then run: Install-Module -Name Az -AllowClobber

Once the Az module is installed, exit the elevated/sudo PowerShell session and open a regular PowerShell session.

Connect to your Azure account - Connect-AzAccount and use the device login URL and Code to sign in.

If you don’t know the exact Publisher Name, you can find it by looking at all the Publishers.

Use Get-AzVMImagePublisher -Location ‘LocationName’ to get a full list of the Publishers that have Images in that Location.

Use Get-AzVMImagePublisher -Location ‘LocationName’ | where -Property PublisherName -match “string with *" to narrow down the list.

Match will work with the * wildcard, in my testing this returned more matches than I was expecting. (I should point out I was using PowerShell 6.1, in case that makes a difference.)

LocationName can be ’eastus’ or ‘westus’, etc. It will also accept ’east us’, in my testing.

When you have the Publisher Name you can get the list of all their VM Images by using: Get-AzVMImageOffer -Location ‘LocationName’ -PublisherName ‘PublisherName’

This will return the Offer and Id, in addition to the PublisherName and Location.

comments powered by Disqus