When Azure Virtual Desktop autoscale isn’t shutting down idle session hosts, unused resources can keep running and increase costs. The good news is that the cause is often a setting, schedule, or usage condition you can check and correct.
This guide walks through common reasons Azure Virtual Desktop autoscale is not shutting down idle hosts, including session limits, scaling plans, and host pool configuration. With a few practical checks, you can get autoscaling back on track and make sure idle hosts power down as expected.
Diagnose Azure Virtual Desktop autoscale not shutting down idle hosts
If a host stays on after users leave, the next step is to find out whether autoscale is still within its configured schedule or cannot make the required change. I usually check the schedule first, then confirm the service has permission to manage the session host.
Start with the time window and rules that decide when hosts can be shut down. Small differences between the schedule and your expectations can explain why an idle host remains powered on.
Check the autoscale plan and schedule
In the Azure portal, open the scaling plan and review the schedule assigned to the host pool. Confirm that the right days and time zone are selected, and that the ramp-down period has started. A schedule set in the wrong time zone can make autoscale appear to ignore an otherwise correct shutdown rule.
Next, inspect the ramp-down settings that affect how many hosts must remain available. In particular, check the minimum percentage of hosts and the capacity threshold. If the minimum is higher than expected, autoscale may keep hosts running even when they have no active users.
- Confirm the schedule covers the current day and local operating hours.
- Check the minimum host percentage and capacity threshold against your intended overnight capacity.
- Review the ramp-down option for handling disconnected sessions; those sessions may prevent a host from being treated as idle.
For a useful test, compare the host’s power state and user sessions with the schedule’s ramp-down rules at the time you expect shutdown. This helps distinguish a timing issue from a host that is being kept available by a configured minimum.
If the schedule allows the host to stop but it remains on, check whether the autoscale service can act on the host pool and its virtual machines. Permissions are a common reason a plan looks correct but cannot complete a power operation.
Verify host pool settings and permissions
Make sure the intended host pool is associated with the scaling plan and that autoscale is enabled for it. Then check the plan’s managed identity and its role assignments. The identity needs the required permissions to read host pool information and start or stop session host virtual machines, scoped to the relevant Azure resources.
I also check for recent changes to the host pool or VM resource groups. Moving a VM, changing resource scopes, or removing a role assignment can leave the managed identity without access. Verify that the necessary Azure Virtual Desktop and VM permissions apply to the current resource locations, rather than relying on an assignment that covers only the former scope.
If the settings and access look right, review autoscale-related activity and error details in Azure. A failed power operation or authorization error can point directly to the missing permission or resource. This narrows the diagnosis without changing unrelated host pool settings.
Once the schedule and permissions check out, the remaining clues are often in how autoscale evaluates capacity and user sessions. I’d check these settings before changing the plan, since a small threshold adjustment can make a big difference to overnight shutdowns.
Fix Azure Virtual Desktop autoscale not shutting down idle hosts
Two details can explain why a host stays online: the plan may still need its capacity, or a session may prevent the host from being stopped. The checks below help separate those cases.
First, compare the ramp-down rules with the host pool’s session limits. This can show whether autoscale is keeping a host available for capacity reasons rather than overlooking an idle machine.
Review ramp-down thresholds and session limits
Check the ramp-down capacity threshold alongside the minimum percentage of hosts. The threshold guides when autoscale starts reducing capacity, while the minimum percentage limits how far it can scale down. If the minimum is set to keep several hosts online, an empty host may remain powered on because the plan still needs that baseline.
Also review the host pool’s maximum session limit. This limit controls how many users can be placed on each host; it does not, by itself, tell autoscale to shut down an idle VM. However, a low limit can spread users across more hosts, leaving sessions on machines you expected to empty. For example, if users are distributed across three hosts, autoscale may have fewer session-free hosts available to stop.
To narrow it down, compare the configured limits with actual session placement during ramp-down. If capacity settings allow more hosts to stop but sessions are spread out, consider whether your session limit and load-balancing approach match your intended host utilization.
If the thresholds allow a shutdown, look at the host’s drain state and session details next. Drain mode can stop new users from arriving, but it does not automatically end sessions already on the machine.
Check drain mode and active sessions
In the Azure portal, inspect the session host’s Allow new sessions setting and review its session list. Autoscale may place a host in drain mode during ramp-down so new connections go elsewhere. If an existing session remains— including a disconnected session—the host may not be eligible to shut down under the plan’s current rules.
Decide how you want ramp-down to handle those users. If your policy permits it, configure the plan’s force logoff option and allow enough wait time for users to save their work. Otherwise, keep the host available until sessions end naturally. I avoid manually signing users out just to test autoscale; first confirm the plan’s behavior and communicate any logoff policy.
- Check whether sessions are active or disconnected, not just whether users appear online.
- Confirm drain mode is preventing new connections from replacing sessions that have ended.
- Review autoscale activity after the configured wait period to see whether the host was stopped or a session blocked the action.
Test and monitor shutdown behavior
Once the settings look right, a controlled test can show whether autoscale is making the expected decision—or where it gets stuck. I use a quiet period and a clear record of what happened to confirm the fix without disrupting users.
Start with one session host and a planned test window. The steps below help you observe the full sequence, from the host becoming idle to the power operation completing.
Run a controlled idle-session test
Choose a host with no users who need to stay connected, and note its current power state, session list, and drain status. Make sure the test falls within a ramp-down period, then wait for the plan’s evaluation and any configured grace period to finish. Avoid changing several settings at once; a single-variable test makes the result easier to interpret.
During the test, record the key times: when the last session ends, when the host enters drain mode, and when autoscale attempts to stop the VM. I also check whether a new connection lands on the host during this window, since that can change its eligibility. Compare the outcome with the plan’s configured minimum capacity and session-handling rules.
- Expected result: the host is considered eligible, then its VM enters a stopped or deallocated state according to the configured action.
- If it stays on: note whether the evaluation kept it for capacity, detected a session, or reported an operation error.
- Afterward: confirm the host can accept connections again when the next scale-up period begins.
A successful test confirms the behavior at that moment, but recurring issues can be harder to catch. Logs help show whether later failures share the same cause or happen only at particular times.
Monitor logs for recurring shutdown failures
Enable diagnostic settings for the relevant Azure Virtual Desktop resources and send the available autoscale evaluation logs to a Log Analytics workspace. I also review the Azure Activity Log for VM power-operation events and failures. Together, these records can distinguish a decision not to shut down from a shutdown request that failed.
When an idle host remains online, filter the records by the host pool, VM resource, and test time. Look for the evaluation outcome, any stated reason the host was retained, and errors such as authorization or resource-operation failures. Match timestamps across the logs; this makes it easier to follow one shutdown attempt rather than mistake an unrelated event for the cause.
If the same failure appears repeatedly, keep a short record of the affected host, time, and error message before making a targeted change. I find that this pattern is more useful than changing thresholds based on a single unexplained event. Once corrected, repeat the controlled test and verify that both the evaluation and the VM power state show the expected result.
Get Azure Virtual Desktop autoscale back on track
When Azure Virtual Desktop autoscale is not shutting down idle hosts, the cause usually comes down to when the plan runs, how much capacity it must retain, whether sessions remain, or whether it has permission to stop the VM. Checking these factors in sequence helps you target the issue without making unnecessary changes.
After adjusting the relevant settings, test the shutdown process during a quiet period and use logs to confirm what autoscale decided and whether the VM power operation succeeded. With a clear test and ongoing monitoring, you can keep hosts available when users need them—and reduce avoidable costs when they don’t.