Forum Discussion
Scaling Plan with AVD session hosts on Azure Local doesn't perform a clean shutdown
Try this as workaround:
1. Custom Automation for Clean Shutdown
Use Azure Automation or PowerShell scripts to:
• Gracefully log off users
• Stop services
• Trigger a clean shutdown before deallocation
Stop-Computer -ComputerName "SessionHost01" -Force
You can schedule this to run just before the scaling plan kicks in.
2. Use Logoff + Delay Strategy
• Configure session hosts to log off disconnected users automatically
• Add a buffer time between user logoff and VM deallocation
• This gives the OS time to settle before shutdown
3. Monitor with Event Logs
Track shutdown events using:
• Event ID 6008 (unexpected shutdown)
• Event ID 1074 (planned shutdown)
This helps validate whether your workaround is working.
- MattENZOct 14, 2025Copper Contributor
If the session host is shutdown prior will it still deallocate properly to not continue charging service fees? When I was talking to MS in a billing support ticket they said that it will still continue to incur fees in a shutdown state. Doing it this way also adds complexity when you want to keep a certain percentage online.
I don't really see why the scaling plan can't just cleanly shutdown the session host before deallocating?