Azure Shared Image Gallery and Windows Virtual Desktop

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:

  1. Deploy a Virtual Machine for creating and customizing the image
  2. Make a disk Snapshot
  3. Creating a Virtual Machine Capture
  4. Create a Shared Image Gallery
  5. 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

  1. Sign into the Azure portal at https://portal.azure.com.
  2. Use the type Shared image gallery in the search box and select Shared image gallery in the results.
  3. 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 

 

 

 

Mahmoud A. ATALLAH

Microsoft MVP | Speaker | Azure Service Delivery Lead at Bespin Global MEA, helping customers build successful Azure practices. Talks about #AzureCloud and #AI

Recent Posts

Gitex – Ensuring a Secure & Scalable AI-powered Solution with Azure

In this session, we will explore the architecture and best practices for building secure and…

2 months ago

Part 4: Data Exfiltration Playbook – Azure WAF Security Lab

Introduction Welcome to our comprehensive series on Azure Web Application Firewall (WAF) security! In this…

3 months ago

Part 3: Vulnerability Exploitation Playbook – Azure WAF vs XSS

Introduction Welcome to the third installment of our Azure Web Application Firewall (WAF) Security Lab…

4 months ago

Part 2: Reconnaissance Playbook – Testing Azure WAF Protection

Introduction Welcome to the second installment of our Azure Web Application Firewall (WAF) Security Lab…

4 months ago

Part 1: Lab Setup – Building Your Azure WAF Testing Environment

Introduction Welcome to the first installment of our four-part Azure Web Application Firewall (WAF) Security…

4 months ago

Azure Web Application Firewall: A Hands-on Security Lab Series

Introduction In today's digital landscape, protecting web applications from sophisticated attacks is crucial. Azure Web…

4 months ago