You can break the process into two primary stages:
**Stage 1: Build the image and store it in the Shared Image Gallery (SIG) :**Set up the AIB:
- Follow the guide provided by Daniel Sol's GitHub repository (it is detailed)
- Create a JSON template to define your image-building steps. For example:
- Specify the base image (Win10 Multi-Session). - Add customizations (install FSLogix, 7Zip...) using inline PowerShell or scripts stored in Azure Storage/Repo. - Include updates by enabling `installUpdates` in the template.
"inline": [ "powershell.exe -command Install-Module -Name FSLogix -Force", "powershell.exe -command Invoke-WebRequest -Uri "powershell.exe -command Start-Process -FilePath C: ]
1.Create an Azure DevOps pipeline:**
- Use the Azure CLI task to submit the AIB template for building. yaml
- task: AzureCLI@2
inputs:
azureSubscription: 'YourServiceConnection'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az image builder create --resource-group YourResourceGroup \
--image-template ./path/to/your-template.json
- Output to SIG: Configure the AIB template to publish the built image to the SIG and specify the target SIG resource group and image definition details.
- Trigger CI/CD Updates: Add a pipeline task to trigger builds on code changes or on a schedule ( for ecample monthly updates).
Stage 2: Deploy the image to Windows Virtual Desktop (WVD)
- Define the WVD Environment: You need to have a WVD host pool configured so yoy can use Azure PowerShell or the Azure CLI to manage the host pool and VM deployment.
- Create a DevOps Release Pipeline:
- Use the image version stored in the SIG to deploy VMs and add tasks to:
- Provision VMs using the image from SIG.
- Assign them to the WVD host pool.
- task: AzureCLI@2
inputs:
azureSubscription: 'YourServiceConnection'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az vm create --resource-group YourResourceGroup \
--name YourVMName \
--image /subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Compute/galleries/<gallery-name>/images/<image-name>/versions/<image-version> \
--size Standard_D2_v3 \
--admin-username azureuser \
--generate-ssh-keys
Then use inline PowerShell scripts or DSC extensions to automate FSLogix configuration on each VM during deployment.
Links to help you :
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/image-builder-overview
https://learn.microsoft.com/en-us/azure/virtual-machines/shared-image-galleries