Skip to main content Explore View all products (200+) Microsoft Foundry Azure Copilot GitHub Copilot Azure Kubernetes Service (AKS) Azure Cosmos DB Azure Database for PostgreSQL Azure Arc Microsoft Fabric Linux virtual machines in Azure Foundry Models Foundry Agent Service Foundry IQ Foundry Tools Foundry Control Plane Observability in Foundry Control Plane Azure OpenAI in Foundry Models Azure Speech in Foundry Tools Azure Machine Learning View all databases Azure Cosmos DB Azure DocumentDB Azure SQL Azure Database for PostgreSQL Azure Managed Redis Microsoft Fabric Azure Databricks Linux virtual machines in Azure Windows Server on Azure Azure Functions Azure Virtual Machine Scale Sets Azure API Management Azure Container Apps Azure Kubernetes Service (AKS) Azure Kubernetes Fleet Manager Azure Container Registry Azure Red Hat OpenShift Azure Container Instances Azure Container Storage Azure Arc Azure Local Microsoft Defender for Cloud Azure Monitor Microsoft Sentinel Azure Migrate View all solutions (40+) Cloud solutions for small and medium businesses Cloud migration and modernization center Data analytics for AI Azure Databases AI apps and agents Microsoft Marketplace Microsoft Sovereign Cloud AI apps and agents Responsible AI with Azure AI Infrastructure Data analytics for AI Machine learning operations (MLOps) Low-code application development on Azure Integration Services Serverless computing DevOps Migration and modernization center .NET apps migration Databases on Azure Linux on Azure Oracle on Azure SAP on the Microsoft Cloud Adaptive cloud High-performance computing (HPC) Infrastructure as a service (IaaS) Resiliency Azure Essentials Frontier Accelerate for Azure FinOps on Azure Microsoft Marketplace Azure pricing overview Create an Azure account Free Azure services Flexible purchase options Pricing calculator FinOps on Azure Maximize ROI from AI Azure savings plans Azure reservations Azure Hybrid Benefit Virtual Machines Azure SQL Microsoft Foundry Microsoft Fabric Azure Kubernetes Service (AKS) Microsoft Defender for Cloud View more Software Development Companies Microsoft Marketplace Find a partner Resources for Azure partners Get started with Azure Customer stories Analyst reports, white papers, and e-books Videos Learn more about cloud computing Documentation Explore Azure portal Developer resources Quickstart templates Resources for startups Developer community Students Azure for partners Blog Events and Webinars Learn Support Contact Sales Get started with Azure Sign in

In May 2018, we launched the limited preview of Shared Image Gallery. We observed very encouraging adoption levels and we have further improved Shared Image Gallery based on your feedback. Today, we are excited to announce the public preview of Shared Image Gallery.

Shared Image Gallery provides an Azure-based solution to make the custom management of virtual machine (VM) images easier in Azure. Shared Image Gallery provides a simple way to share your applications with others in your organization, within or across regions, enabling you to expedite regional expansion or DevOps processes, simplify your cross-region HA/DR setup and more. Shared Image Gallery also enables you to quickly deploy thousands of VMs concurrently from a custom image.

Management of images

Shared Image Gallery introduces three new resources that help with managing customer images. In order of hierarchy, these are:

  • Shared Image Gallery
  • Image Definition
  • Image Version

Shared Image Gallery

Using these three resources, it is possible to organize various custom images that might be used in an organization. For example, it is possible to define a common Image Definition for all the versions that are updated regularly.

Sharing of Images across subscriptions

Each of the three new resource types introduced with Shared Image Gallery can be shared with another user, service principal or an AD group through Role Based Access Control. Once shared, a VM or virtual machine scale sets (VMSS) can be created in any subscription within the same AD tenant as the image.

image

Replicating to different Azure regions

Shared Image Gallery allows you to replicate your Image Versions across different regions. This means you can publish all your Image Versions in one region and then replicate them to different regions as needed. Once the replication is complete, you can deploy a VM or VMSS in that region. Shared Image Gallery also allows you to replicate the versions to different regions independently of each other. One example of this scenarios is where the latest versions are always replicated globally while the older versions are only replicated in one region to save storage costs as shown below.

image

Scale of VM/VMSS deployments

Shared Image Gallery introduces a concept of a replicaCount which is the number of copies to keep for the image in a region. This can help in scenarios where you are trying to create 100s/1000s of VMs from the same image concurrently. A Managed Image can be the bottleneck as all the VMs try to read data from the same storage blob. With additional replicas, now you can ensure the reads are spread to different replicas thereby reducing the chance of a single replica being the bottleneck for your VM deployment set. You can specify a global replica count to be used as the default for all the regions and a way to override the regional replica count in a specific region. In the example below, the Image Version has a replica count of five. So, when you try to create 50 concurrent VMs from it, they are spread to each of the replicas.

image

Regional availability

Shared Image Gallery introduces the concept of “source” and “target” regions.

  • Source region – Source region is where the original Image Version is created.
  • Target region – These are the regions where you tell Azure to replicate the image to. These can be updated after the Image Version has been created. These are the regions where you can create a VM or VMSS from the Image Version.

Here are the regions you can use currently:

Create Gallery in i.e. “source region” Replicate Version to i.e. “target region”
West Central US All Azure Public Cloud regions
South Central US  
East US 2  
Southeast Asia  
West Europe  

Getting Started with CLI

Shared Image Galleries is in preview, but you need to register the feature before you can use it. To register the Shared Image Gallery feature:

az feature register --namespace Microsoft.Compute --name GalleryPreview
az provider register -n Microsoft.Compute

It might take a few minutes to register the feature. You can check the progress using:

az provider show -n Microsoft.Compute

Create an image gallery

az group create -n rg -l westcentralus
az sig create -g myGalleryRG --gallery-name myGallery

Create an Image Definition

az sig image-definition create -g myGalleryRG --gallery-name myGallery --gallery-image-definition myImageDefinition --publisher myPublisher --offer myOffer --sku myLinux1--os-type Linux

Create an Image Version

az sig image-version create -g sig1 --gallery-name gal1 --gallery-image-definition image1 --gallery-image-version 1.0.2 --target-regions "West Central US" "South Central US=1" "East US 2=1" --replica-count 5 --managed-image 

Create a VM

az vm create -g rg -n rg-vm --image /subscriptions//resourceGroups/rg/providers/Microsoft.Compute/galleries/gallery1/images/gallery-image1/versions/1.0.0

Create a VMSS

az vmss create --resource-group myResourceGroup --name myScaleSet --admin-username azureuser --generate-ssh-keys --image /subscriptions//resourceGroups/rg/providers/Microsoft.Compute/galleries/gallery1/images/gallery-image1/versions/1.0.0

Documentation links

WE ARE MICROSOFT

Explore Microsoft Foundry

The future of AI starts here. Envision your next great AI app with the latest technologies. Get started with Azure.