The bill for servers moved to Azure often comes out above what was projected in the migration project. The cause is rarely the prices; it’s on-premises habits carried over to the cloud unchanged. VMs are sized large “just in case,” left on 24/7, and disks left over from migration aren’t deleted. Idle capacity on premises was paid for once. In the cloud it is paid for every hour. Below are the size, disk and availability decisions for Azure IaaS virtual machines and the practical steps that keep cost in check. We don’t give price examples; for current, region-specific figures, use the Azure pricing calculator.
Azure VM series and selection
Azure VM size names follow a pattern; whoever can read the pattern makes the right choice. For example Standard_D4ds_v5: D family (general purpose), 4 vCPU, d has a local temporary disk, s supports Premium storage, v5 generation. In the name, the letter a indicates an AMD processor and p an ARM-based processor.
| Series | Profile | Typical use |
|---|---|---|
| B | Credit-based, burstable | Servers with low average load, management servers |
| D | General purpose, balanced CPU/memory | Application servers, small databases, DCs |
| E | Memory-optimized | SQL Server, caching, memory-intensive applications |
| F | Compute-optimized | Batch processing, web front ends |
| L | High local storage performance | NoSQL, big data |
| M / N | Very large memory / GPU | SAP HANA, compute and graphics |
The B series looks cheap, but a machine that runs out of CPU credits drops to its baseline performance. If you put an application server that carries load all day on the B series, it works well in the morning and the “server is slow” call comes in the afternoon. Limit the B series to servers with low average load and short bursts. The point most often overlooked in selection: every VM size has its own disk IOPS, disk bandwidth and network bandwidth limits. A fast disk attached to a small VM gets stuck at the VM’s limit. When disk performance is the complaint, look at the VM size limit first, then the disk. Instead of copying the vCPU and memory values of a server coming from on premises, start from actual usage data; the logic is the same as the principles in the vCPU, memory and NUMA sizing article.
Managed disk types and performance limits
| Disk type | Performance model | Operating system disk | Suitable workload |
|---|---|---|---|
| Standard HDD | Low, variable latency | Yes | Archive, test, infrequent access |
| Standard SSD | Depends on size, consistent | Yes | Light production, web, development |
| Premium SSD | Depends on size tier (P10, P30…) | Yes | Production servers, databases |
| Premium SSD v2 | Capacity, IOPS and bandwidth set separately | No | Database data disks |
| Ultra Disk | Very low latency, set separately | No | Very latency-sensitive databases |
With Premium SSD, performance depends on disk size: for more IOPS you choose a larger tier and also pay for capacity you don’t use. Premium SSD v2 breaks this link; capacity, IOPS and bandwidth are set separately, and every disk has a free baseline performance (3,000 IOPS and 125 MB/s). However, Premium SSD v2 and Ultra Disk can’t be operating system disks, don’t support host caching, and may not be offered in every region or for every VM size. With Standard HDD and Standard SSD, the number of transactions is charged separately. On an I/O-heavy workload, a disk that looks cheap comes back as an unexpected item on the bill.
Availability: zones, sets and single VMs
In Azure, high availability is designed together with the application architecture. Counting a single VM as redundant “because it’s in the cloud” is wrong. A single VM is a single VM. There are three basic options:
- Single VM: Microsoft’s SLA depends on the disk type; the highest single-VM commitment is given for a single VM whose disks are all Premium SSD or Ultra. A short outage can occur during host maintenance and failures.
- Availability set: Spreads VMs across different fault and update domains within the same data center. Protects against rack or host failure; doesn’t protect against data center loss.
- Availability zone: Places VMs in physically separate data centers in the same region. Traffic between zones brings additional latency and, in some cases, data transfer cost.
An availability set or zone only makes sense if the workload runs on at least two VMs with load balancing or application-level replication between them (two DCs, SQL Always On and so on). Putting a single VM in a zone doesn’t make it redundant. Verify the current SLA values in Microsoft’s online services SLA document. Region-level outages are a separate design topic, covered in the disaster recovery with Azure Site Recovery article.
Items that determine cost
A VM’s bill isn’t made up of compute alone:
- Compute: VM size and running time. For Windows VMs, the operating system license is included in this item too.
- Disks: Paid for even when the VM is off. The provisioned tier for Premium SSD, plus the number of transactions for Standard disks.
- Snapshots and backups: Forgotten snapshots and long retention periods silently pile up.
- Network: Static public IP addresses, data leaving Azure (egress), traffic between zones and regions, VPN/ExpressRoute gateways.
- Monitoring: The volume of data sent to the Log Analytics workspace. A diagnostic setting turned on to “collect everything” becomes a separate item at the end of the month.
A common mistake is shutting down the VM from inside the operating system. The screen goes dark and everyone thinks the machine is off. But the VM stays in the “Stopped” state, the hardware stays allocated and compute charges continue. To stop the charges, the VM must be deallocated (Stopped (deallocated)) through the portal, CLI or PowerShell. Stop-AzVM in Az PowerShell deallocates by default; with -StayProvisioned it doesn’t. On a deallocated VM, disks and static IPs continue to be charged.
Azure Hybrid Benefit and reservations
There are two main ways to lower cost in continuously running server infrastructure:
- Azure Hybrid Benefit: Lets you use your Windows Server (and SQL Server) licenses with Software Assurance or on subscription in Azure, so that the operating system license fee is deducted from the VM price. There is a similar model for RHEL and SUSE. Eligibility depends on your licensing agreement; verify the rules on overlap with on-premises use rights with your licensing specialist. The general framework is in the Windows Server licensing for virtualization article.
- Reserved Instances and Savings Plan: A discount in return for a one- or three-year commitment. A reservation is tied to a specific VM family and region; a savings plan is an hourly spend commitment and is more flexible across families. Make the commitment after right-sizing. Taking a three-year reservation on an oversized VM locks in the waste for three years.
Spot VMs can also be considered for batch jobs that can tolerate interruption. Azure takes these VMs back at short notice when it needs capacity; they aren’t suitable for production servers.
Right-sizing and auto-shutdown
Right-sizing isn’t a one-time project but a regular server and cloud management task. The order of work:
- Collect data: At least two to four weeks of CPU, memory, disk and network metrics with Azure Monitor. The memory metric comes from the guest operating system; for this, Azure Monitor Agent and VM Insights must be enabled. Without memory data, the size decision is made with half the data.
- Review Azure Advisor recommendations: It recommends downsizing or shutting down low-utilization VMs. Before applying, look at monthly and periodic loads; a server that runs at month-end close looks idle in the first week of the month.
- Change the size: A size change requires a restart; do it in a maintenance window.
- Clean up orphaned resources: Unattached disks, old snapshots, unused public IPs.
# Sizes available on the current host
az vm list-vm-resize-options -g rg-app -n vm-app01 -o table
# Change the size (the VM restarts)
az vm resize -g rg-app -n vm-app01 --size Standard_D2s_v5
# Disks not attached to any VM
az disk list --query "[?diskState=='Unattached'].{Name:name, RG:resourceGroup, GB:diskSizeGb}" -o table
# Enable Azure Hybrid Benefit on an existing Windows VM
az vm update -g rg-app -n vm-app01 --set licenseType=Windows_Server
# Automatic shutdown outside working hours (time is UTC)
az vm auto-shutdown -g rg-test -n vm-test01 --time 1700
# Deallocate to stop compute charges
az vm deallocate -g rg-test -n vm-test01
If the size you want isn’t in the list, it isn’t available in the current hardware cluster; the VM is deallocated first, then resized. Auto-shutdown only shuts down; it doesn’t start the VM in the morning. If both shutdown and startup are needed in test and development environments, use Microsoft’s “Start/Stop VMs v2” solution or Azure Automation runbooks.
Operations checklist
- Every resource has owner, cost center and environment tags; Cost Management reports are broken down by these tags.
- Budgets and threshold alerts are defined at the subscription or resource group level.
- A shutdown schedule is applied for non-production VMs.
- Unattached disks, old snapshots and unused public IPs are checked monthly.
- Hybrid Benefit and reservation eligibility have been evaluated for continuously running VMs.
- The disk type was chosen based on the workload’s measured IOPS and latency needs; the VM size’s disk limit was checked.
- A backup policy (Azure Backup or third party) and retention period are defined, and restore has been tested.
- Updates are managed with a patch process; for the options, see the patch management including Azure Update Manager article.
For the current performance limits of disk types, use the Azure managed disk types page in Microsoft Learn as the reference. For setting up, migrating or reviewing the cost of an Azure environment, you can review the scope on the Microsoft 365, Azure, AWS and Google Cloud services page.
Frequently asked questions
Does shutting down the VM from the operating system stop the charges?
It doesn’t. A VM shut down from inside the operating system stays in the Stopped state; since the hardware remains allocated, compute charges continue. To stop the charges, deallocate the VM through the portal, Azure CLI or PowerShell; disks continue to be charged.
Can Premium SSD v2 be used as an operating system disk?
No. Premium SSD v2 and Ultra Disk are used only as data disks. Premium SSD or Standard SSD is chosen for the operating system disk; database data files can be placed on Premium SSD v2.
When should a reservation be bought?
After right-sizing is complete and it is clear that the server will run continuously for at least the commitment period. For uncertain workloads, a savings plan, which is more flexible across families, can be considered.
Which licenses are eligible for Azure Hybrid Benefit?
Windows Server and SQL Server licenses covered by Software Assurance or subscription-based are eligible; there is a separate model for RHEL and SUSE. Exact eligibility depends on your licensing agreement; verify with your licensing provider.