> ## Documentation Index
> Fetch the complete documentation index at: https://help.nops.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Shut Down Underutilized Azure Virtual Machine

> Shut down or delete an Azure virtual machine that Azure Advisor finds almost unused.

When a virtual machine barely uses its CPU, memory and network, Azure Advisor recommends shutting it down rather than resizing it. nOps imports these recommendations, checks them against your bill, and shows the estimated monthly saving.

| | |
| - | - |
| **Cloud** | Microsoft Azure |
| **Category** | Compute |
| **Service** | Virtual Machines |
| **Action** | Stop |
| **Effort** | Low |
| **Restart needed** | No |
| **Can be rolled back** | Yes |
| **Analysis window** | Last 7 days |
| **Source** | Azure Advisor |

## Why it matters

An idle VM bills for every hour it runs. Test machines and leftovers from old projects are common examples.

## How nOps finds it

This recommendation comes from Azure Advisor, which looks at the VM's peak (P95) CPU, memory and network use over its lookback period and recommends shutting it down. nOps imports Advisor's recommendations daily and checks each one against your own Azure bill for the last 7 complete days: the resource must still be billed in the last 3 days of that window, and Advisor's estimate is capped at what the resource actually cost (Advisor prices at pay-as-you-go rates, so you may pay less through discounts, reservations or savings plans). Recommendations worth less than \$1 a month are left out.

## Before you start

Confirm with the owner that nothing depends on the VM, including scheduled or occasional jobs.

## How to implement

1. Confirm with the owner what the VM runs and whether it is still needed.
2. To keep it, stop it from the Azure portal (**Stop**) or with `az vm deallocate --resource-group RESOURCE_GROUP --name VM_NAME`, so it shows **Stopped (deallocated)**. Shutting down from inside the operating system does not stop compute billing.
3. If it is no longer needed, take a snapshot of any disk you might need, then delete the VM and its disks, and remove it from Terraform, Bicep or ARM templates.

## Risks and considerations

* Managed disks and reserved public IPs keep billing while the VM is deallocated.
* A deallocated VM can get a new dynamic public IP when it starts again.
* Deleting cannot be undone; take snapshots first if the data may be needed.

## FAQs

> [accordion] Is stopping the VM enough?
>
> Only if it is deallocated. A VM shut down from inside the operating system stays allocated and keeps billing for compute.

## Related

* [Right-size Azure Virtual Machine](https://help.nops.io/inform/supported-recommendations/right-size-azure-virtual-machine)
* [Schedule Non-Production Azure VMs](https://help.nops.io/inform/supported-recommendations/schedule-non-production-azure-vms)
* [Delete Disks of Stopped Azure VMs](https://help.nops.io/inform/supported-recommendations/delete-disks-of-stopped-azure-vms)
* [Supported recommendations](https://help.nops.io/inform/supported-recommendations.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.