Skip to content
AzureAzure Virtual Machine Scale SetsCompute

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_windows_virtual_machine_scale_set runs a group of identical Windows VMs behind shared scaling and load-balancing. Cost is per instance-hour at the Windows VM rate (which includes the per-core license surcharge) × the instance count, three Standard_D2s_v5 instances (~$0.188/hour each) is ~$412/month, plus each instance's managed OS disk.

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

DimensionUnitWhat's being charged
Scale set instancesper instance-hourinstance 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 disksper disk-monthEach 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.72

Optimization tips

Common ways to reduce azurerm_windows_virtual_machine_scale_set cost without changing the workload.

Use autoscale instead of a fixed instance count

Often 30 to 50% on variable load

A 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 fleet

Every 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 instances

A 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 baseline

For 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_D2s_v5 instances is ~$412/month. Autoscale varies the count, so cost tracks how many instances actually run.

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