Azure Deallocate VM: Portal, CLI and Auto-Shutdown Schedules You shut down a VM, the status says "Stopped," and the bill keeps climbing. Many Azure users hit this exact surprise. A guest OS shutdown can leave the VM allocated on a host, and Azure keeps billing compute for it.

Deallocation fixes that. It releases the VM's compute capacity while keeping the VM resource and its configuration for a later restart. This guide covers three workflows: deallocating in the Azure Portal, using Azure CLI, and scheduling recurring auto-shutdown. Attached disks, snapshots, and other resources can still incur charges after any of them.

Key Takeaways

  • An OS-level shutdown is not the same as an Azure deallocation.
  • The Portal's Stop button and az vm deallocate both produce "Stopped (deallocated)."
  • Auto-shutdown suits predictable idle hours; production jobs need exclusions and restart tests.
  • Deallocation ends VM compute billing, not disk, snapshot, or static IP charges.

What Azure VM Deallocation Means

Stopped vs. Stopped (deallocated)

Per Microsoft's billing states, the three states bill differently:

Status Meaning VM compute billed?
Running Fully up Yes
Stopped (allocated) Powered off but still on a host. A guest OS shutdown can cause this. Yes
Stopped (deallocated) Hardware lease released No

An OS shutdown is never proof of deallocation. Check the status in Azure.

What still costs money

Deallocation is not deletion. These items can keep billing:

  • Managed OS and data disks, charged by provisioned size and tier
  • Snapshots
  • Static public IPs, charged whether or not they're attached
  • Azure Backup data, including after you stop protection
  • Azure Monitor ingestion, retention, and alert rules

Windows licensing is murkier. If you use Azure Hybrid Benefit, check your own agreement rather than assuming deallocation cancels license costs.

Operational effects

  • Dynamic public IPs are released, so the address can change after restart. Static IPs remain.
  • The temporary resource disk is not persistent. Data can be lost.
  • OS and data disks are unaffected.
  • Ephemeral OS disks don't support stop-deallocate at all.
  • Restart can fail with AllocationFailed if the region or zone lacks capacity. On-demand Capacity Reservations help availability-sensitive workloads.

Azure VM deallocation operational effects and restart risks

Which approach fits?

  • Manual deallocation: one-off cases, such as a test VM you won't need for weeks.
  • Recurring schedule: dev, test, and training VMs with predictable idle hours.
  • Job-completion automation: batch or intermittent workloads where the VM should stop when work ends, not at a fixed time.

Don't deallocate always-on production systems, clustered workloads, or anything with strict availability requirements without a deliberate architecture for it.

How to Deallocate an Azure VM in the Portal and CLI

Use the Azure Portal

  1. Open Virtual machines and select the VM.
  2. On Overview, click Stop.
  3. Click Yes to confirm.
  4. Wait until the status reads Stopped (deallocated), not just "Stopped."

Before you click, check:

  • Active sessions and unsaved work
  • Application dependencies on this VM
  • Recent backup status
  • Whether you need a fixed public IP
  • Whether attached disks must stay available

Use Azure CLI

Select the right subscription first:

az account set --subscription <subscription-name-or-ID>

Then deallocate:

az vm deallocate --resource-group <resource-group> --name <vm-name>

You can also pass --ids with several resource IDs. Note that --no-wait only skips waiting for the long-running operation. It doesn't confirm completion.

Verify the result with either command:

az vm get-instance-view -g <resource-group> -n <vm-name>
az vm show -g <resource-group> -n <vm-name> -d

The -d flag returns power-state details. Look for a deallocated state. az vm stop is not the same command: it leaves compute billed.

Deallocate multiple VMs cautiously

List VM IDs in a resource group, then feed them to deallocate:

az vm list -g <resource-group> --query "[].id" -o tsv

Before any bulk action:

  • Use an explicit allowlist or tag filter
  • Exclude production VMs
  • Do a dry run that only lists targets
  • Log every action and handle errors per VM

Four safeguards for bulk Azure VM deallocation actions

How to Configure Azure VM Auto-Shutdown Schedules

Set a schedule in the Portal

  1. Open the VM and go to Operations > Auto-shutdown.
  2. Switch it On.
  3. Set the daily shutdown time.
  4. Choose the time zone. The default is UTC.
  5. Optionally set Send notification before shutdown to Yes, then add an email address or webhook URL.
  6. Click Save.

Notifications are a heads-up, not monitoring. You still need to confirm the VM actually reached its target state. Interface labels change, so compare against Microsoft's current auto-shutdown guide.

Match the schedule to the workload

Good fits:

  • Development environments
  • Temporary test VMs
  • Training systems
  • Predictable overnight or weekend idle windows

Poor fits include workloads with unpredictable demand or strict availability requirements.

Watch for these risks:

  • Wrong time zone (UTC is the default, so a US team can shut down mid-afternoon)
  • Daylight saving time shifts (Microsoft does not document how this feature handles them)
  • Shared environments where colleagues are still working
  • Jobs still running when shutdown hits

Document the schedule owner and intended business hours.

Validate and govern it

  • Confirm the setting saved
  • Watch the first scheduled shutdown
  • Verify the power state is deallocated
  • Test startup before relying on it for savings

A key limit: the Auto-shutdown pane handles shutdown only and has no start schedule. A 2021 Microsoft article says it deallocates the VM, but current Learn docs do not restate billing behavior, so verify the power state yourself.

When you need more, consider these alternatives:

  • Azure Automation: runbooks with Start-AzVM and Stop-AzVM -Force, with recurrence and daylight saving support
  • Logic Apps: Microsoft recommends these or Automation for dev/test start-stop schedules
  • Start/Stop VMs v2: schedules, sequencing, and CPU-based AutoStop, though it is maintenance-only with no new features

Azure VM scheduling alternatives comparison for automated start stop control

Costs, Caveats, and Verification

Common failure modes

  • The VM sits in "Stopped (allocated)" and keeps billing
  • A dynamic IP changes after restart and breaks DNS or firewall rules
  • Auto-shutdown is applied to the wrong VM
  • The workload doesn't resume cleanly
  • Restart fails for lack of capacity

Verify savings

Don't assume a clean shutdown erased spend. Use:

  • Azure Cost Management: actual vs. amortized cost views
  • Activity Log: records the management operation, kept 90 days by default
  • Resource Health: VirtualMachineDeallocationInitiated means requested, not completed
  • VM status: the final word on state

Compare these charges before and after:

  • Compute
  • Disks and snapshots
  • Public IPs and networking
  • Licensing
  • Backup and monitoring

Azure VM cost categories to compare before and after deallocation

Basic SKU public IPs were retired September 30, 2025, so check any you still have.

Scaling VM Shutdown Policies Across Azure Environments

Standardize with governance

  • Tags mark eligible VMs. Azure Policy can require them and inherit them from resource groups.
  • Management groups push policy and RBAC down the hierarchy.
  • RBAC. Virtual Machine Contributor includes deallocate permissions.
  • Runbooks apply schedules consistently.
  • Documented exceptions cover production and business-critical VMs.

Microsoft's built-in VM policy list doesn't include a standalone auto-shutdown enforcement policy, so expect custom work.

Report on results

Track results against your own billing data:

  • Idle time
  • Schedule compliance
  • Failed shutdowns and restart failures
  • Estimated savings

Flexera's 2026 report puts estimated cloud waste at 29% of spend, but that is survey context, not what shutdowns will save you.

Don't forget the disks

Deallocation does nothing for persistent block storage. Microsoft states that unattached disks keep charging after VM deletion. Disks stay billed on every deallocated VM too.

Lucidity covers that gap for enterprise teams. Its Lumen product gives real-time visibility into block storage volumes and flags four idle disk types:

  • Unattached
  • Reserved
  • Unmounted
  • Zero-I/O

Lucidity says these can account for up to 70% of unused block storage spend, and Lumen surfaces idle disks that native dashboards miss. It isn't a VM scheduler. It handles the storage side.

Four idle Azure block storage disk types and unused spend impact

Frequently Asked Questions

What happens to a deallocated VM in Azure?

Azure releases the VM's compute capacity but keeps the VM resource for a later start. Disks and other attached resources can still incur charges.

Are Azure VMs automatically patched?

Platform maintenance covers hosts, not guest OS patching. Guest patching depends on the image, Automatic VM Guest Patching or Update Manager settings, and the VM running. Deallocated VMs are skipped.

Does deallocating an Azure VM stop all charges?

Compute charges stop once deallocation is confirmed. Storage, IPs, licensing, backup, and monitoring can continue. Check current Azure pricing pages.

What is the difference between stopping and deallocating an Azure VM?

An OS shutdown or power-off leaves the VM allocated and billed. Deallocation is an Azure control-plane operation that releases the compute hardware.

How do I deallocate an Azure VM using Azure CLI?

Run az vm deallocate --resource-group <resource-group> --name <vm-name>. Then check the power state with az vm show -d to confirm.

Does Azure auto-shutdown deallocate a VM?

A Microsoft article states that auto-shutdown deallocates the VM. Verify the power state after the first run. Use Automation or Logic Apps if you need start schedules or event-driven control.