Best Practices for Automation

Practical guidance for running Atlas AVD automation safely using the guardrails built into the product.

Keep the maintenance-mode safeguard on

For DrainGuard, leave Require Maintenance Mode on so only hosts already withheld from new sessions are eligible for deletion. When you turn it off, Atlas tells you how many idle VMs would newly qualify and asks you to confirm; treat that prompt as a real warning, not a formality.

Start in monitoring-only mode

Turn off Delete Idle VMs when you first enable DrainGuard. It then evaluates your settings without deleting anything, and the If DrainGuard Ran Right Now... preview shows exactly which VMs would go and what you'd save. Switch deletion on once the preview matches what you expect.

Scope automation windows to genuine off-hours

Set the DrainGuard cleanup window and days to real off-peak times in the correct timezone. Watch the status banner: Misconfigured – No Days Selected means it will never run. For autoscale schedules, remember that From and To times follow the pool's Azure region, not your browser.

Overnight windows crossing midnight are fine, but double-check behavior around daylight-saving changes: a window may skip once in spring and repeat once in fall.

Read the confirmation before you save

DrainGuard lists destructive changes (enabling it, turning off Require Maintenance Mode, turning on Delete Idle VMs, or cutting the idle threshold by more than half) and asks you to confirm before saving. Drain & Reclaim shows how many hosts will be deleted now and how many will be drained first, and requires elevated permissions. Read what a change will affect before you confirm, since deletions are permanent.

Pair Power-On-Connect with Start VM on Connect

Optimize for Power-On-Connect in a pool's autoscale settings removes all always-on and pre-warmed hosts. Only use it when the pool's Power on Connect switch (Settings → Compute & Deployment → Deployment Defaults) is also on; otherwise a pool scaled to zero rejects new connections.

Respect the gap when tuning Adaptive Density

When editing density templates, keep the Lower Density threshold well below the Raise Density threshold. Atlas requires Lower to be below Raise (the Medium template uses 40% and 80%) so the engine doesn't flip-flop the session limit every cycle; a wider gap and a sensible cooldown produce steadier behavior. Remember that template edits affect every pool using that template.

Roll out gradually and use per-pool settings

Turn features on for a small set of pools first. Adaptive Density requires each pool to opt in even when the tenant-wide toggle is on, so you can pilot on one pool before expanding. DrainGuard settings are tenant-wide defaults that individual pools can override, and autoscale lets each pool inherit or override the tenant defaults.

Know your kill switches

Each engine has a master control. DrainGuard's tenant-wide switch overrides every per-pool setting, and Adaptive Density's Global toggle stops all pool scaling when off. Use these to halt automation instantly during an incident rather than editing pools one by one.

Destructive and tenant-wide changes ask for confirmation by design; if you are moving fast, don't reflexively click through them.

Next steps