Azure Virtual Desktop | Image Builder part II
In the previous post (Azure Image Builder | Part I) we have created a resourceGroup, managed Identity and a RBAC role for the creation of images. When this setup is done, you are able to create a compute gallery with a image definition name.
Azure Compute Gallery
Azure Compute Gallery, formerly known as Shared Image Gallery, is a service that helps you manage and share resources like images and application packages across your organization. It provides global replication, versioning, and grouping of resources for easier management. You can use Azure Compute Gallery to create image definitions, which are logical groupings for versions of an image. These definitions hold information about the image, such as the operating system, features it supports, and other usage information. An image version is what you use to create a VM when using a gallery. You can have multiple versions of an image as needed for your environment. The gallery allows you to share your resources with everyone, or limit sharing to different users, service principals, or Active Directory (AD) groups within your organization. Resources can be replicated to multiple regions, allowing for quicker scaling of your deployments.
Image Definition
An image definition in an Azure Compute Gallery is a logical grouping for versions of an image. It carries information about the image and requirements for using it internally. This includes whether the image is Windows or Linux, release notes, and minimum and maximum memory requirements. Image definitions are created within a gallery and can be used to create an image version in a gallery. An image version is what you use to create a VM when using a gallery. You can have multiple versions of an image as needed for your environment. In essence, an image definition is a type of image that provides a blueprint for creating VMs in Azure. It allows you to manage and organize your images effectively, making it an essential component of the Azure Compute Gallery.
How to setup
Create an Azure Compute Gallery
$resourceGroup = "myPreviousCreatedImageBuilderResourceGroup"
$galleryName = "myFirstGallery"
$galleryDescription = "my description about myFirstGallery"
$location = "myPreviousUsedLocation"
$gallery = New-AzGallery -ResourceGroupName $resourceGroup -Name $galleryName -Location $location -Description $galleryDescription
Create an Image Definition
$galleryImageDefinitionName = "myGoldenimage"
$publisherName = "myPublisherName"
$offerName = "myOfferName"
$skuName = "mySKU"
$description = "A Description about myGoldenImage"
$IsHibernateSupported = @{Name='IsHibernateSupported';Value='True'}
$IsAcceleratedNetworkSupported = @{Name='IsAcceleratedNetworkSupported';Value='False'}
$ConfidentialVMSupported = @{Name='SecurityType';Value='ConfidentialVMSupported'}
$features = @($IsHibernateSupported,$IsAcceleratedNetworkSupported, $ConfidentialVMSupported)
New-AzGalleryImageDefinition -ResourceGroupName $resourceGroup -GalleryName $galleryName -Name $galleryImageDefinitionName -Location $location -Publisher $publisherName -Offer $offerName -Sku $skuName -OsState "Generalized" -OsType "Windows" -Description $description -Feature $features -HyperVGeneration "V2"