Azure shared image gallery is a feature that helps you to manage VM images and deploy them across the world. This service enables you to do versioning and grouping of images. Moreover, image stored in shared image gallery can be shared across subscriptions and even between Active Directory. In this topic, we will see how to leverage Azure shared image gallery.

Create a VM image

First, you need a VM image. To create this image, we need to deploy an Azure VM. To do so, open the marketplace and create an Azure VM with the operating system of your choice. In my example, I selected Windows Server 2019. As usual, fill the field with your settings such as the resource group, the VM name, region and so on.

Create a VM

Do not forget to specify the network configuration especially if you want to customize your image before the capture:

Specify the network configuration

Once the VM is created, connect to that VM to make the customization, the updates and so on.

Connect to that VM to make the customization

Once you have finished your customization you can run sysprep. Open a command prompt and run the following command:

C:\windows\system32\sysprep\sysprep.exe /oobe /shutdown /generalize /mode:VM

Now go back in the Azure Portal and open VM overview. Now you can capture your VM:

Azure Portal and open VM overview

Then provide name for the image. I selected also to delete virtual machine after the image is created.

Provide name for the image

Now, you have VM image and we can integrate it into Azure shared image gallery.

Azure shared image gallery

Create an Azure shared image gallery

To open the service, just type shared image gallery in the search bar in Azure Portal.

Search bar in Azure Portal

Now click on Create shared image gallery.

Create shared image gallery

Specify the name, the region and the resource group where belong this new shared image gallery.

Specify the name

Once the shared image gallery is created, you should retrieve it in the previous window:

Image gallery is created

Add image to azure shared gallery

Open the gallery and click on Add new image definition:

Add new image definition

Then specify a region, an operating system, a VM generation the state of the OS, a publisher an offer and a SKU.

Add new image definition

In version screen, first specify a version name. Then choose the source image that is the one we have captured previously from the Azure VM. You can specify an end of life date for the image and the target region. As you can see, you can easily distribute your VM image across Azure region.

Distribute your VM image across Azure region

In the next screen, you can specify publishing meta data and VM size recommendation.

Specify publishing meta data

It can take a while to distribute VM image across region. Once it is distributed, the image is available in the gallery.

The image is available in the gallery

Now you can click on Create VM button from the gallery. Then you get the same screen as usual when you want to create an Azure VM excepted in Image field. Now you can select the image from your gallery.

Select the image


As you have seen, the deployment and configuration of Azure Shared Galleries is easy. It can help you to manage your VM images and distribute them across Azure region. Thanks to this feature, you can have streamlined VMs in Azure.

Views All Time
Views Today
Appreciate how useful this article was to you?
No Ratings Yet
Back to blog
The following two tabs change content below.
Romain Serre
Romain Serre
Senior consultant at Exakis
Romain Serre works in Lyon as a Senior Consultant. He is focused on Microsoft Technology, especially on Hyper-V, System Center, Storage, networking and Cloud OS technology as Microsoft Azure or Azure Stack. He is a MVP and he is certified Microsoft Certified Solution Expert (MCSE Server Infrastructure & Private Cloud), on Hyper-V and on Microsoft Azure (Implementing a Microsoft Azure Solution).