azurerm_ windows_ virtual_ machine_ scale_ set cost estimation
A fleet of identical Windows VMs that scales as a unit, billed per instance-hour (Windows rate). Three Standard_D2s_v5 instances are ~$412/month.
An azurerm_
The defining cost lever is autoscaling. A scale set fixed at a high instance count pays for peak capacity 24/7; autoscale rules that add instances under load and remove them when idle pay for peak only when peak happens. A fleet sized for a daily traffic spike but autoscaled can run a fraction of the flat-count cost.
Because these are Windows instances, the license premium applies to every instance, so Azure Hybrid Benefit (bring your own Windows licenses) and Spot instances (for fault-tolerant fleets) are major levers, alongside reservations for the steady baseline count.
c3x prices the scale set from sku and instance count, so the fleet's cost, and the effect of the instance count, is visible before deployment.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "azurerm_windows_virtual_machine_scale_set" "web" {
name = "web-vmss"
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
sku = "Standard_D2s_v5"
instances = 3
admin_username = "azureadmin"
admin_password = var.admin_password
os_disk {
storage_account_type = "Premium_LRS"
caching = "ReadWrite"
}
source_image_reference {
publisher = "MicrosoftWindowsServer"
offer = "WindowsServer"
sku = "2022-datacenter-azure-edition"
version = "latest"
}
}Pricing dimensions
What you actually pay for when you provision azurerm_.
| Dimension | Unit | What's being charged |
|---|---|---|
| Scale set instances | per instance-hour | instance count × the Windows VM rate (includes the license surcharge), billed continuously. Autoscale varies the count. $0.188/instance-hour for Standard_D2s_v5 (Windows) → 3 instances ≈ $411.72/month |
| OS disks | per disk-month | Each instance's managed OS disk bills per tier on top of compute. |
Sample C3X output
Three Standard_D2s_v5 Windows instances running 24/7 (compute only):
azurerm_windows_virtual_machine_scale_set.web
└─ Scale set instances (D2s_v5 Windows × 3) 2190 instance-hours $411.72
Monthly $411.72Optimization tips
Common ways to reduce azurerm_ cost without changing the workload.
Use autoscale instead of a fixed instance count
Often 30 to 50% on variable loadA scale set pinned at peak count pays for peak 24/7. Autoscale rules add instances under load and remove them when idle, paying for peak only when it happens, usually the biggest scale-set saving on variable traffic.
Apply Azure Hybrid Benefit
Up to ~40% of compute across the fleetEvery instance carries the Windows license premium. Azure Hybrid Benefit applies existing Windows Server licenses across the fleet, removing the license portion, a large saving multiplied across all instances.
Use Spot instances for fault-tolerant fleets
Up to ~90% on Spot instancesA scale set with Spot priority runs evictable instances at a deep discount, right for stateless, fault-tolerant fleets behind a load balancer. Keep a small regular-priority baseline for guaranteed capacity.
Reserve the baseline count
40 to 60% on the steady baselineFor the instances the fleet always runs, a reservation discounts that baseline; autoscale the variable top end on regular or Spot pricing.
FAQ
How is a Windows VM Scale Set billed?
Per instance-hour at the Windows VM rate (including the per-core license surcharge) × the instance count, plus each instance's OS disk. Three Standard_
How do I reduce scale-set cost?
Autoscale instead of fixing the count at peak, apply Azure Hybrid Benefit to remove the Windows license premium across the fleet, use Spot instances for fault-tolerant workloads, and reserve the steady baseline count.
How does c3x estimate the cost?
From sku and the instance count, pricing instance-hours at the Windows rate. Autoscaling means actual cost moves with the running count; the estimate reflects the configured instances.
Related resources
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including azurerm_.