Table of Contents
Shared Image Gallery
Shared Image Gallery help you share your custom VM images with others in your organization, within or across regions, within an AAD tenant. Also enables us to build all our VM images from a single Master VM ( Golden Image ) and use it to deploy IaaS VMs as well as we can use it for Windows Virtual Desktop Deployment, You can for example have a Definition for each golden image that you use for a hostpool. You can have an image definition for your IT Team, another one for call center with their special software and an incident management system, and another image definition for your power users like graphic designer with adobe and designing tools. Create Custom Windows 10 Image for WVD How to manage and deploy custom images (including versioning) with the Azure Shared Image Gallery
Divided into the following steps:
- Deploy a Virtual Machine for creating and customizing the image
- Make a disk Snapshot
- Creating a Virtual Machine Capture
- Create a Shared Image Gallery
- Add an image to the Shared Image Gallery
Deploy a Virtual Machine for Master Image
Make a disk Snapshot
Keep in mind that You can run the Sysprep command up to 8 times on a single Windows image, then you must recreate your Windows image for another sysprep, hence we will take a Snapshot of the master vm before any sysprep activity. Deallocate the VM
Open Disk blade then click on the disk
Create a snapshot
Creating a Virtual Machine Capture
Now lets sysprep the windows and capture the vm
NOTE: Since Capturing a virtual machine image will make the virtual machine unusable. Would be better to Select Automatically delete this virtual machine after creating the image for VM Cleaning up.
Create a Shared Image Gallery
Shared images can be replicated to multiple regions, for quicker scaling of your deployments. When you create a VM from the image, a copy of the VHDs in the image are used to create the disks for the new VM. The image remains in storage and can be used over and over again to create new VMs. If you have a large number of images that you need to maintain and would like to make them available throughout your company, you can use a Shared Image Gallery as a repository. Create an Azure Shared Image Gallery using the portal
- Sign into the Azure portal at https://portal.azure.com.
- Use the type Shared image gallery in the search box and select Shared image gallery in the results.
- In the Shared image gallery page, click Create.
Select the Subscription and Resource group then give the instance a name, select the Region and last Click Review + create
Add an image to the Shared Image Gallery
When we need to deploy Windows, virtual machines using Terraform or if we need to create a 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, windows-10-1909-vhd-client-office-prod-stage, windows-10-2004-vhd-client-office-prod-stage
- Version: The version number of an image SKU. Examples: 20h1-evd-o365pp, 19h2-pro-g2.
Listing Image Offers
Open our Azure Cloud Shell (PowerShell) or Azure PowerShell CLI.
Connect-AzAccount -TenantId “” $publisher = “MicrosoftWindowsDesktop” $location = “West Europe” Listing Image Offers Get-AzVMImageOffer -Location $location -PublisherName $publisher | Select Offer
Listing Image SKUs $offer = “windows-10-2004-vhd-client-office-prod-stage” Get-AzVMImageSku -Location $location -PublisherName $publisher -Offer $offer | Select Skus
Now we have the right Offer and SKU lets continue with the creation.
Update the Offer and SKU with the output that we got from PowerShell.
The image version name in the semantic version pattern. The allowed characters are digit and period.
For example: 0.0.1, 15.35.0, x.x.x format.
Click Review + create