AVD Golden Image Management: Build, Version, Test and Roll Out Safely
By Jay H.Published Updated 10 min read
Jay H. · Founder, Sessionright
Founder of Sessionright. Twenty years running Citrix, NetScaler, Citrix Cloud, NetScaler Console, Azure and Azure Virtual Desktop estates; writes the guides and reviews the platform's rules.
Stuck on this right now? Talk it through with a Sessionright engineer: 15 minutes, free.
AVD golden image management is four jobs: build a generalized image, publish it as a numbered version in Azure Compute Gallery, prove it on a test host pool, then replace session hosts in batches while keeping the previous version for rollback. On pooled host pools Microsoft recommends image-based servicing "because it provides consistent host configuration, easier rollback, and reduced impact to active user sessions" (update methodologies). The native rollout tool, session host update, only works on pooled host pools created with a session host configuration (management approaches). Every other pool needs your own replace-and-drain process.
Checked against Microsoft Learn on 27 November 2026, this guide ends with a build method, a versioning scheme, a rollout for either kind of host pool and a rehearsed rollback.
What belongs in the golden image and what belongs in policy
Session host update replaces the VMs, so "any customizations, such as files, registry keys, or certificates that were added manually to session hosts, aren't present after the update." Microsoft gives three homes for them: the image itself, configuration management "such as Intune or Group Policy", or the custom configuration PowerShell script in the session host configuration (session host update).
| Put it in the image | Put it in policy or a deploy-time step |
|---|---|
| OS build and the latest cumulative update at build time | Settings that change between rebuilds (Intune or Group Policy) |
| Large, slow-changing apps, Office, language packs | Apps that change often: Azure Compute Gallery VM apps exist so you don't "publish a new image for every line of code change" |
| FSLogix, Teams optimizations, time zone redirection (all built-in custom image template scripts) | Monitoring agents: the Azure Monitor agent isn't installed automatically on updated hosts; Microsoft suggests Azure Policy |
| Nothing host-specific | Domain join and host pool registration: never deploy the Azure Virtual Desktop Agent into the image, or new hosts "will fail to join the host pool" (golden image) |
Also keep out Unified Write Filter, which "is not supported for session hosts", and, if you image an existing session host, the C:\packages\plugin folder, which stops the DSC extension that joins new hosts (session host update).
The build options Microsoft documents
| Option | What it needs | When it fits |
|---|---|---|
| Custom image templates (Azure Virtual Desktop portal) | Seven registered resource providers, including Microsoft.VirtualMachineImages and Microsoft.ContainerInstance; a user-assigned managed identity with a custom role that writes image versions; internet access for the build VM (create templates) |
Portal-driven builds with built-in scripts for language packs, FSLogix, Teams, session timeouts, Windows Updates (custom image templates) |
| Azure VM Image Builder directly | The same service, driven by PowerShell, Azure CLI, ARM templates or a DevOps task that is "(preview)"; a user-assigned identity to distribute images (Image Builder) | Pipelines you already run, builds kept as code |
| Captured VM | A base VM, snapshots along the way, sysprep, then Capture in the portal (golden image) | Apps that need hands-on installation |
Neither the custom image templates nor the session host update pages carry a preview label on 27 November 2026. Image Builder "currently does not support Azure Hybrid Benefit for Windows Server", and its USGov Arizona and USGov Virginia regions are "(public preview)" (Image Builder). Your own scripts must sit at "a publicly available location, such as GitHub, a web service, or your own storage account" (with a role such as Storage Blob Data Reader), inside a Build timeout (minutes) long enough to finish them (create templates).
For a captured VM: leave the domain and disable antivirus before sysprep, delete the VM after capture, "Don't try to capture the same VM twice", and start the next base VM from your last snapshot, not from a custom image (golden image).
When a template build fails, read customization.log in the packerlogs container of the storage account in the IT_<ResourceGroupName>_<TemplateName>_<GUID> resource group; built-in script entries start Starting AVD AIB Customization (troubleshoot templates). The page also covers an unreachable script URI and a generation mismatch with the gallery definition.
Versioning in Azure Compute Gallery
A gallery holds image definitions (one per image type, identified by a unique Publisher, Offer and SKU combination) and, under each, image versions, which are what you deploy (gallery images).
- Create one definition per image line, for example multi-session with Microsoft 365, and set its generation to match the source image (create templates).
- Number every build
MajorVersion.MinorVersion.Patch; a custom image template generates one if Gallery image version is blank. - Publish with Excluded from latest set to Yes until testing passes, so nothing deploying "latest" picks it up.
- Replicate to every region with session hosts. Microsoft suggests one replica per 20 VMs created concurrently and at least two replicas for session host update; replication "can take a few hours in some cases" (Compute Gallery; update how-to).
- Prefer Standard ZRS over the Standard LRS default where zones exist, and keep "at least two galleries in separate regions" for disaster recovery.
Limits per subscription per region: 100 galleries, 1,000 image definitions, 10,000 image versions, and 100 replicas per version (Compute Gallery). An end-of-life date on a version is "informational"; VMs can still be created from it (gallery images).
Testing before rollout
Microsoft recommends testing "on a test host pool aligned to the host pool you want to update", covering the update process and the new apps or hotfixes (session host update). Mark that pool as a validation environment so it also receives Azure Virtual Desktop service updates first (validation environment):
Update-AzWvdHostPool -ResourceGroupName <resourcegroupname> -Name <hostpoolname> -ValidationEnvironment:$true
Users "should connect as frequently to the validation host pool as they do to the standard host pool", and it shouldn't serve production. Check each new version:
- Hosts show Available (if not, see AVD session host unavailable).
- Pilot users sign in, profiles attach, core apps start.
- Group Policy, Intune and monitoring agents apply to the new hosts.
- The AVD health check checklist passes.
Then set Exclude from latest to No.
Rolling a new image out
Host pools with a session host configuration: session host update
- Disable autoscale: "If a scaling plan is enabled during an update, the update can fail" (session host update). Re-enable it after (scaling plan guide).
- Point the session host configuration at the new version. The PowerShell cmdlets for these pools are in preview and need the preview Az.DesktopVirtualization module, version 5.3.0 or later (update how-to):
$parameters = @{
HostPoolName = '<HostPoolName>'
ResourceGroupName = '<ResourceGroupName>'
ImageInfoType = 'Custom'
CustomInfoResourceID = '/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroupName>/providers/Microsoft.Compute/galleries/<GalleryName>/images/<ImageName>/versions/<ImageVersion>'
}
Update-AzWvdSessionHostConfiguration @parameters
- Set the batch size and sign-out behaviour with
Update-AzWvdSessionHostManagement(UpdateMaxVmsRemoved,UpdateLogOffDelayMinute,UpdateLogOffMessage). Microsoft recommendsUpdateDeleteOriginalVM = $true"so that you don't need to clean up session host resources after an update". Portal defaults are a batch of 1, a 2-minute sign-out delay (0–60 allowed) and UTC as the time zone (management approaches). - Start it now or schedule it up to two weeks ahead:
Invoke-AzWvdInitiateSessionHostUpdate. Once scheduled, settings can't be edited; cancel and reschedule instead. - Watch
Get-AzWvdSessionHostManagementsUpdateStatus(PercentComplete,ProgressSessionHostsRollbackFailed) or the banner under Session hosts; progress reads 0.00% until the first host finishes (session host update).
Batch size is the most hosts unavailable at once: 10 hosts with a batch of three means one initial host, then three batches of three, leaving at least seven available (session host update). Size it against peak load and quota; one update per host pool at a time.
What a failed batch looks like. If the initial host fails, "the update stops"; an unrecoverable host is left in drain mode. Large batches can fail intermittently with AgentRegistrationFailureGeneric, which a retry "typically resolves". Invoke-AzWvdControlSessionHostUpdate takes Action = 'Retry', 'Pause', 'Resume' or 'Cancel'. A pause not resumed within two weeks becomes a cancel, and a cancel leaves mixed hosts, so schedule another "as soon as possible" (update how-to).
Standard host pools: replace and drain
Standard pools "can't use session host update"; Microsoft points to "automated pipelines and custom scripts" (management approaches). The documented workflow is to publish the version, "deploy new session hosts, then drain and remove the old session hosts" (update methodologies):
- Generate a registration key, valid for the window you set (Microsoft's example is 24 hours), with
New-AzWvdRegistrationInfo(add session hosts). - Deploy one batch of new hosts from the new version, matching the pool's size, name prefix and identity provider.
- Tag the old hosts with the scaling plan's exclusion tag: in pooled pools "autoscale overwrites drain mode" (autoscale scenarios).
- Drain the old batch:
Update-AzWvdSessionHostwithAllowNewSession = $False. Existing sessions stay until users sign out or you end them (drain mode). - When a host has no sessions, run
Remove-AzWvdSessionHost -HostPoolName <String> -Name <String> -ResourceGroupName <String>(cmdlet reference), then delete the VM. - Repeat per batch. A failed batch is new hosts that never reach Available: stop, leave the old hosts serving, fix, then continue.
Rollback
Microsoft's pages describe no undo for a completed update; returning means another rollout. Keep the previous version, then:
- Session host configuration pools: run
Update-AzWvdSessionHostConfigurationwithCustomInfoResourceIDpointing at the previous version and schedule an update. If you cancel mid-rollout, that next update is also how you restore parity (update how-to). - Standard pools: replace and drain again from the previous version. Old hosts not yet removed are the fastest way back: turn their drain mode off and drain the new ones.
- Anything that deploys "latest": set Exclude from latest on the bad version so the previous highest version is chosen again (gallery images).
How often to rebuild
Microsoft's servicing tables, by session host OS (update methodologies):
| Update type | Windows multi-session | Windows Server |
|---|---|---|
| Monthly security and quality | Session host update and Azure Compute Gallery "Recommended"; Windows Update "Not recommended" | Azure Update Manager and automatic guest patching "Recommended"; session host update "Not recommended" |
| Feature updates | Session host update "Recommended" | Don't apply |
| OS version upgrade | New VMs from a new image, "Recommended, using session host update"; in-place "Not supported" | New VMs from a new image |
Hotpatch is "Not supported" on multi-session. For pooled multi-session, then, the documented model is a new image for each monthly cumulative update: that is your cadence, plus an out-of-cycle build when an app in the image changes. The built-in Apply Windows Updates script brings each build current.
The image jobs and what native tooling covers
| Job | Native tooling | What it doesn't cover |
|---|---|---|
| Build the image | Custom image templates, Image Builder, manual capture | Hybrid Benefit for Windows Server on Image Builder; private script hosting without a role assignment |
| Version it | Compute Gallery numbering, replication, exclude from latest | Enforcing end-of-life: the dates are "informational" |
| Test it | Validation host pool flag; test pool recommended | The test itself: sign-ins, apps and profiles are yours to check |
| Roll out in batches | Session host update, pooled pools with session host configuration, global Azure only | Standard pools, personal pools, Azure Government: your own scripts and pipelines |
| Roll back | Another update to the previous version | A one-step revert |
| Patch between rebuilds | Windows Update, Azure Update Manager, Configuration Manager, per OS | Multi-session: Windows Update is "Not recommended", so the image is the patch path |
The gaps fall to your own scripts and pipelines or a management layer on Azure Virtual Desktop; for scaling, see AVD native autoscale limits.
FAQ
What is a golden image in Azure Virtual Desktop?
A custom image "that contains all apps and configuration settings you want to apply to your deployment" (golden image).
How do I update the image on AVD session hosts?
On a pooled host pool with a session host configuration, change the image in the configuration and schedule a session host update. On a standard pool, deploy new hosts from the new version and drain and remove the old ones (management approaches).
Can I add a session host configuration to an existing host pool?
No. The management approach "is set when you create a host pool and can't be changed later" (management approaches). Using session host update means creating a new pooled host pool.
How long does a session host update take?
Microsoft says "around 20 minutes" per session host, with each batch updated concurrently (update how-to).
Want a second pair of eyes?
Sessionright's free AVD assessment is one read-only command in Azure Cloud Shell that produces an HTML report in about five minutes. Sessionright for Azure Virtual Desktop assesses estates read-only and plans changes, including images and image rollouts, that run only after a named approver signs off, with a dry-run, verification, rollback and an audit log; scaling stays on Microsoft's native autoscale. It is read-only by default, and every change is approved and logged (security). The licence is annual and priced by estate size, not per user (pricing). If you would rather talk it through, book a 15-minute call: no install, no sales deck.
Sources
- Microsoft Learn: Custom image templates in Azure Virtual Desktop
- Microsoft Learn: Use custom image templates to create custom images
- Microsoft Learn: Troubleshoot custom image templates
- Microsoft Learn: Create a golden image in Azure
- Microsoft Learn: Azure VM Image Builder overview
- Microsoft Learn: Store and share resources in Azure Compute Gallery
- Microsoft Learn: Store and share images in Azure Compute Gallery
- Microsoft Learn: Session host update for Azure Virtual Desktop
- Microsoft Learn: Update session hosts using session host update
- Microsoft Learn: Host pool management approaches
- Microsoft Learn: Windows update management methodologies for session hosts
- Microsoft Learn: Configure a host pool as a validation environment
- Microsoft Learn: Drain session hosts for maintenance
- Microsoft Learn: Add session hosts to a host pool
- Microsoft Learn: Autoscale scenarios
- Microsoft Learn: Remove-AzWvdSessionHost
Want this watched for you, with the fix drafted before you ask?
Sessionright is an AI operator for Azure Virtual Desktop: it checks session hosts, scaling plans, FSLogix and cost continuously, attaches the evidence, and proposes fixes for a named approver to sign. It has run against simulated estates and Sessionright's own Azure lab tenant so far. To see what it finds on your own estate, run the free assessment: one command in Azure Cloud Shell reads your estate, never changes it, and writes an HTML report in about five minutes for a typical estate. Your estate data stays with you unless you choose to email yourself the HTML report through Sessionright. Design partner program: 90-day free Operator pilot, then 50% off year 1; list price at signing held to month 24. Engineer-led assessments are 50% off for design partners. Outside the program the onboarding assessment is $2,500, up to 500 users, one tenant.
Not ready for that? Talk to a Sessionright engineer: 15 minutes, free, and you leave with a next step.
Or get the next guide by email. One email per new guide, no marketing list.
Related guides
- How to Add an Existing VM to an AVD Host Pool
Add an existing VM to a standard Azure Virtual Desktop host pool. Generate a registration key, register the VM and verify the new session host is available.
- AVD Session Host Unavailable or Needs Assistance: How to Fix
Fix an AVD session host stuck in Unavailable, Needs Assistance or Upgrade Failed: read the health checks, re-register the agent and test required URLs.
- AVD Host Pool Change Audit Logs in Azure Monitor
Find who changed an AVD host pool, check which properties changed, and configure Azure Virtual Desktop diagnostics for future management activity.
- AVD Host Pool Configuration: Azure Portal Settings
Configure an AVD host pool in the Azure portal. Choose pooled or personal desktops, set session routing, and review validation, RDP and VM startup settings.
- AVD Health Check: 40-Point Checklist for Azure Virtual Desktop
A 40-point AVD health check for Azure Virtual Desktop: the PowerShell, portal path or query for each check, what good looks like, and the Microsoft source.
Citrix and NetScaler are trademarks of Citrix Systems, Inc. and/or its affiliates. Azure is a trademark of the Microsoft group of companies. Sessionright is not affiliated with or endorsed by Cloud Software Group, Citrix or Microsoft.