Back to articles Azure Virtual Desktop / Cost

AVD autoscale: where scaling plans reach their limits

DN
Drazen Nikolic
8 min read

With autoscale, Azure Virtual Desktop has its own scaling built in. A scaling plan starts and stops session hosts by schedule and occupancy, and Microsoft charges nothing extra for it. For most host pools it replaces the earlier Azure Automation scripts, and Microsoft explicitly recommends the switch.

The limits only show up in operation: hosts keep running at night, a public holiday is treated like a normal working day, and autoscale reverts the drain mode set for maintenance. Microsoft documents most of this, but spread across the how-to guide, the FAQ and the troubleshooting article. Below they are collected in one place, each with a workaround.

Autoscale counts sessions

For pooled host pools, autoscale works with the number of sessions relative to the available capacity. Capacity is the number of running hosts times the max session limit of the host pool. When occupancy exceeds the capacity threshold of the current phase, autoscale starts another host.

The Microsoft example: two running hosts with a limit of 20 sessions give 40 slots. With a threshold of 75 percent, the third host starts as soon as more than 30 sessions are running. If occupancy sits exactly on the threshold, nothing happens, autoscale only reacts to values above or below it.

Two things follow. The max session limit has to be set deliberately, the guide requires a custom value and advises against the default. And CPU or memory do not appear in the calculation. A host with 15 compute-heavy sessions counts the same as one with 15 idle sessions. User groups with very different load are therefore easiest to separate into their own host pools with their own session limit.

Disconnected sessions keep hosts awake

The Microsoft troubleshooting article lists this problem first: after hours, hosts stay on although nobody is working. The cause is disconnected sessions. Autoscale treats them like active ones, because the user could come back at any moment, and keeps capacity ready for them.

Microsoft gives the number of hosts that stay running as a formula: sessions (active and disconnected) divided by max session limit times capacity threshold, rounded up. Nine disconnected sessions with a limit of 5 and a threshold of 90 percent give 9 / 4.5 = 2 hosts. If the minimum percentage of hosts for the phase requires more, that value applies. Getting a pool to zero at night takes four settings:

  • Enable the group policy “Set time limit for disconnected sessions” under Remote Desktop Services, Remote Desktop Session Host, Session Time Limits. Microsoft gives 15 to 30 minutes as an example.
  • In domain environments, link the policy as a GPO to the OU of the session hosts instead of setting it as local policy on individual hosts.
  • Set the minimum percentage of hosts for off-peak to 0 percent.
  • Choose the time limit so that it expires before the ramp-down phase ends.

Without this policy, disconnected sessions have no time limit by default. Anyone who closes the laptop in the evening instead of signing out leaves a disconnected session behind, and with enough of those, several hosts run every night without a single active user.

Autoscale forces sign-out only during ramp-down

The “Force logoff users” option only works in the ramp-down phase. Autoscale picks the host with the fewest sessions, puts it in drain mode, sends the users a message and signs them out after the configured wait time, including users with active sessions. Autoscale then deallocates the VM.

If the wait time is longer than the phase, the sign-out never happens. The FAQ describes a 15-minute ramp-down phase with a 20-minute wait time: the plan moves to off-peak, and autoscale signs nobody out there. The host keeps running until the last user signs out on their own.

The ramp-down phase should therefore be clearly longer than the wait time. Personal host pools have no forced sign-out. There, autoscale only deallocates a VM once the user has signed out or has been disconnected long enough.

Maintenance: autoscale overrides drain mode and load balancing

Anyone who puts a host in a pooled host pool into drain mode for updates gets a surprise: autoscale still changes the drain mode of hosts in the plan, no matter who set it. Load balancing behaves similarly. Autoscale ignores the algorithm from the host pool settings and applies the value set for each phase in the plan.

For maintenance, the intended tool is an exclusion tag. You define its name in the plan, Microsoft uses excludeFromScaling in its example. Autoscale does not start or stop hosts with this tag and leaves their drain mode unchanged.

Excluded hosts still count towards the minimum percentage of hosts. If all remaining hosts are tagged, autoscale starts no further host even at full occupancy, and new users see the message “No resources available”. Remove the tag after maintenance, otherwise the host stays outside scaling for good.

What a scaling plan cannot express

LimitationWorkaround
No public holidays or specific datesAdjust the plan before the holiday with PowerShell or a template and change it back afterwards
One time zone per plan, one plan per host poolPut users in distant time zones into separate host pools with their own plan
No awareness of availability zonesCheck the spread of running hosts across zones yourself, autoscale does not necessarily start and stop them evenly
No failover to a second region during an outageA separate disaster recovery design, autoscale only scales existing VMs in their region
No Azure CLIPortal, PowerShell (Az.DesktopVirtualization 4.2.0 or later) or ARM and Bicep templates
No parallel use with other scaling toolsSwitch off the old Automation script or third-party tool before assigning the plan
Power management creates no new hostsProvide enough hosts for the peak or evaluate dynamic autoscaling (preview)

Holidays come with a second detail. Days not selected in any schedule keep running with the off-peak values of the last selected day. A plan for Monday to Friday therefore holds the weekend at Friday evening levels. A public holiday during the week, on the other hand, gets the full ramp-up.

Dynamic autoscaling: hosts created on demand

Besides power management there is a second method. Dynamic autoscaling starts and stops hosts and also creates new ones or deletes them again. Instead of a fixed set of hosts, you define a minimum and a maximum pool size per phase. The method is in preview and has stricter prerequisites:

  • It only works with pooled host pools created with a session host configuration. Existing pools without this configuration stay on power management.
  • The service principal also needs the Desktop Virtualization Virtual Machine Contributor role.
  • New hosts must reach the endpoint wvdhpustgr0prod.blob.core.windows.net to download the agent. Otherwise deployment fails with CustomerVmNoAccessToDeploymentPackageException. In networks with a firewall and restricted outbound traffic, allow this endpoint in advance.
  • It is not available in Azure Government.

Personal host pools and hibernation

For personal desktops, autoscale works without a capacity threshold. For each phase you define after how many minutes of disconnection or sign-out (0 to 360) the VM is deallocated, hibernated or left alone.

Hibernation saves the reboot but has two limitations. FSLogix and App Attach do not support it, and Microsoft explicitly advises against it for such pools. Microsoft also lists as a known limitation that the RD Agent does not always re-register after resume. If RDAgentBootLoader and RDAgent do not reach the Running state within about five minutes, the host stays unavailable in the pool. For that case Microsoft recommends switching back to deallocation (Stop, deallocate).

If autoscale does not start the desktops itself during ramp-up, Start VM on Connect is required, otherwise nobody reaches their desktop in the morning. Desktops that are started but never signed in to are deallocated again by autoscale after a period without activity.

Prerequisites where setup fails

  • The Desktop Virtualization Power On Off Contributor role for the Azure Virtual Desktop service principal or a managed identity of the host pool. The guide requires the assignment at the level of every subscription that contains hosts. Only someone with Microsoft.Authorization/roleAssignments/write can assign it, meaning Owner or User Access Administrator.
  • A custom max session limit on the host pool.
  • The scaling plan sits in the same region as the host pool metadata. The session hosts themselves can be in any region.
  • At least one session host in the pool and no other scaling tool on the same pool.

Changes to an assigned plan apply immediately, even in the middle of a running phase. Larger changes are therefore best made outside working hours.

Tracing why a host is running

Autoscale writes every evaluation to the Log Analytics table WVDAutoscaleEvaluationPooled once the autoscale diagnostic category is enabled on the host pool. The ScalingReasonMessage column contains what autoscale did and why. Insights can only analyse this for pooled host pools, personal pools send their autoscale logs to a storage account or an Event Hub.

WVDAutoscaleEvaluationPooled
| where TimeGenerated > ago(14d) and ResultType == "Succeeded"
| summarize Hosts = max(ActiveSessionHostCount), Sessions = max(SessionCount),
    Excluded = max(ExcludedSessionHostCount)
    by Day = startofday(TimeGenerated), ConfigSchedulePhase
| order by Day asc, ConfigSchedulePhase asc

The query shows the highest number of active hosts and sessions per day and phase. If more hosts run during off-peak than the sessions explain, the cause is the minimum percentage of the phase or excluded hosts. For failed evaluations, a join on CorrelationId with the WVDErrors table returns the cause. Timestamps are UTC, while the plan runs in its own time zone.

When an additional tool pays off

The earlier scaling tool built on Azure Automation and Logic Apps is no replacement. It also scales by sessions, according to Microsoft supports no scaling by CPU or memory, creates no new hosts and only works within the subscription of the Automation account.

A third-party tool can pay off if scaling should depend on CPU or memory, a holiday calendar is needed or one pool serves users in several time zones. Before that, the existing settings deserve a look. Hosts running needlessly at night often come down to disconnected sessions and a minimum percentage set too high, and both can be fixed in the existing plan.

More on this: Azure Virtual Desktop at thousands of users: what matters in practice

Aligning the plan with two weeks of data

Whether the phases match the working day shows in the autoscale logs together with sign-in times over at least two weeks, split by weekday. An AVD review derives start times, thresholds and minimum percentages per phase from them and calculates how many host hours the revised plan saves per month. Your operations team can then enter and monitor the settings on its own.

New at Microsoft Ignite 2026: Direct Stream: new name for the streaming technology of AVD and Windows 365

Frequently asked questions

Why does AVD autoscale not shut down all session hosts at night?

Usually because of disconnected sessions. Autoscale counts them like active ones and keeps enough hosts ready for users to return. A pool only reaches zero with no sessions at all and a minimum percentage of 0 in off-peak. The group policy “Set time limit for disconnected sessions” signs out disconnected sessions after a fixed time.

Does AVD autoscale take CPU or memory utilisation into account?

No. Autoscale works with the number of sessions, the max session limit of the host pool and the capacity threshold of the phase. Scaling by CPU or memory requires an additional tool.

Can a scaling plan handle public holidays?

No, according to Microsoft autoscale does not support specific dates. A public holiday during the week runs on the normal weekday schedule. The workaround is to adjust the plan beforehand and change it back afterwards.

What is the difference between power management and dynamic autoscaling?

Power management starts and stops existing session hosts and is generally available. Dynamic autoscaling also creates and deletes hosts. It is in preview, only usable for pooled host pools with a session host configuration and not available in Azure Government.

Does autoscale cost extra?

No, Microsoft charges nothing extra for autoscale. The savings come from the compute cost of deallocated VMs. Disks of stopped VMs are still billed.

Sources (as of 15 November 2026)

  1. Microsoft Learn: Autoscale scaling plans and example scenarios in Azure Virtual Desktop
  2. Microsoft Learn: Create and assign an autoscale scaling plan for Azure Virtual Desktop
  3. Microsoft Learn: Azure Virtual Desktop autoscale FAQ
  4. Microsoft Learn: Troubleshoot autoscale issues in Azure Virtual Desktop
  5. Microsoft Learn: Monitor Autoscale operations with Insights in Azure Virtual Desktop
  6. Microsoft Learn: Azure Monitor Logs, WVDAutoscaleEvaluationPooled table
  7. Microsoft Learn: Scale session hosts using Azure Automation and Azure Logic Apps for Azure Virtual Desktop

Are your session hosts running through the night?

With the autoscale logs of the last two weeks, a single conversation can narrow it down: which phase holds too many hosts and what a changed setting is worth per month.

Book an initial call