AzureCompute4 min read

Check Azure VM power states against compute charges

Sources checked September 7, 2026Varies by scope
On this page
THE SHORT ANSWER

Use the instance-view power-state code to assess VM instance-usage billing. Stopped means the VM is allocated on a host but not running and is billed. Deallocated means the VM has released the lease on the underlying hardware and instance usage is not billed.

Why this is worth a look

Azure defines power state as the VM’s last known state and provides billing guidance for each state. The instance view exposes the power-state code under Statuses.Code, including values such as PowerState/running. Get-AzVM with -Status retrieves instance view rather than the default model view, so you can inspect one ordinary VM without changing it. This distinguishes Stopped, which can result from a guest OS shutdown and remains billed, from Deallocated. The result covers VM instance usage only. Azure notes that resources such as disks and networking can still incur charges.

Run this check

CHECKLIST

Run this Azure PowerShell command for one ordinary VM. It reads instance-view Statuses.Code and displays the PowerState code and display status.

Read-only Azure VM power-state inspection
1. Confirm the target is one ordinary Azure VM, not a VM scale set instance.
2. In an Azure PowerShell session using an authorized Azure context, run:
   $vm = Get-AzVM -ResourceGroupName "<resource-group>" -Name "<vm-name>" -Status
   $vm.Statuses | Where-Object { $_.Code -like "PowerState/*" } | Select-Object Code, DisplayStatus
3. Interpret the Code value:
   - PowerState/stopped means billed for instance usage.
   - PowerState/deallocated means not billed for instance usage.
4. Treat the result as the VM’s last known state.
5. Check disks and networking separately. This result does not represent the VM’s total cost.

How to confirm it

  1. 01

    Confirm the VM type and scope

    Use this procedure for one ordinary Azure VM in the selected resource group and subscription. VM scale set instances have a separate documented instance-view operation.

  2. 02

    Read the instance view

    In Azure PowerShell, run Get-AzVM with the resource group, VM name, and -Status. The command retrieves instance view, and the filtering expression selects the status whose Code begins with PowerState/.

  3. 03

    Compare the returned code

    Read the returned Code. PowerState/stopped is billed for instance usage. PowerState/deallocated is not billed for instance usage because the VM has released the lease on the underlying hardware.

  4. 04

    Review other charges and freshness

    This result addresses VM instance usage only. Azure says disks and networking can still incur charges, and power state is the VM’s last known state. Treat the output as a point-in-time read, not a historical usage total.

Before making changes

Assumes a standard Azure VM, the intended subscription and resource group, and an Azure PowerShell session using an authorized Azure context. The command is read-only, has no billing time window, and reports the latest instance-view result returned by Azure, not a historical usage total. The billing interpretation covers VM instance usage only. Transitional states can be billed or not billed according to Azure’s state table, so do not treat them as Stopped or Deallocated.

Ignore this procedure for a VM scale set instance. Azure documents a separate instance-view operation with a scale-set name and instance ID for that resource type.

Primary sources