> ## 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.

# Right-size Azure Virtual Machine

> Resize an underused Azure virtual machine to the smaller size Azure Advisor recommends.

Azure Advisor watches each virtual machine's CPU, memory and network use and recommends a smaller or cheaper size when the VM is consistently underused. nOps imports these recommendations, checks them against your bill, and shows the estimated monthly saving with the VM's current and target size.

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

## Why it matters

VMs are often sized for a peak that never comes or chosen before the workload was known. Rightsizing removes capacity you pay for but do not use.

## 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 a target size. 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. When nOps also suggests moving the same VM to an AMD or current-generation series, only the larger saving is shown.

## Before you start

Permission to resize the VM, and a maintenance window: resizing restarts it.

## How to implement

1. Review the recommended size and confirm it supports what the workload needs (vCPU, memory, temp disk, disk types, network).
2. In the Azure portal, open the VM, go to **Size**, choose the recommended size and select **Resize**. Or use `az vm resize --resource-group RESOURCE_GROUP --name VM_NAME --size SIZE`.
3. If the size is not offered, stop (deallocate) the VM first, then resize.
4. Update Terraform, Bicep or ARM templates so a later deployment does not change it back.

## Risks and considerations

* Resizing restarts the VM, so plan for a short outage.
* A smaller size has less headroom: check peaks outside Advisor's lookback window, such as month-end jobs.
* Data on the temporary disk is lost when the VM moves to other hardware.
* To roll back, resize to the original size.

## FAQs

> [accordion] Why is the saving lower than Advisor shows?
>
> Advisor prices at pay-as-you-go rates. nOps caps the saving at what the VM actually cost you, after discounts and commitments.

## Related

* [Shut Down Underutilized Azure Virtual Machine](https://help.nops.io/inform/supported-recommendations/shut-down-underutilized-azure-virtual-machine)
* [Move Azure VMs to AMD-based Series](https://help.nops.io/inform/supported-recommendations/move-azure-vms-to-amd-based-series)
* [Upgrade Azure VMs from Previous-Generation Series](https://help.nops.io/inform/supported-recommendations/upgrade-azure-vms-from-previous-generation-series)
* [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.