azurerm_machine_learning_compute_instance cost estimation
A managed dev VM for Azure ML, billed the underlying VM rate per hour while running. A Standard_DS3_v2 is ~$214/month if left on — and idle instances are the classic waste.
An azurerm_machine_learning_compute_instance is a managed single-user VM for Azure ML development — notebooks, experimentation, light training. It bills the underlying Virtual Machine rate per hour for every hour it's running, regardless of whether anyone is using it. A Standard_DS3_v2 (4 vCPU, 14 GiB) is ~$0.293/hour, about $214/month if left on around the clock.
The defining cost problem, exactly like a SageMaker notebook, is idle time. Compute instances get started for a session and left running for days, billing nights and weekends for an environment nobody's touching. The single biggest saving is stopping the instance when idle — Azure ML supports idle-shutdown schedules that stop it automatically.
The other levers: right-size the VM size to the actual dev work (most exploration runs fine on a DS-series; reserve GPU sizes for genuine training), and move heavy training to compute clusters (azurerm_machine_learning_compute_cluster) that scale to zero between jobs rather than a big always-on instance.
c3x prices the instance from virtual_machine_size at the VM rate, so the running cost — and the cost of leaving it on — is visible up front.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "azurerm_machine_learning_compute_instance" "dev" {
name = "ml-dev"
machine_learning_workspace_id = azurerm_machine_learning_workspace.main.id
virtual_machine_size = "Standard_DS3_v2"
idle_shutdown {
idle_timeout_in_minutes = 30
}
}Pricing dimensions
What you actually pay for when you provision azurerm_machine_learning_compute_instance.
| Dimension | Unit | What's being charged |
|---|---|---|
| Compute instance | per hour | The underlying VM rate per hour for every hour the instance is running. Stopped instances bill no compute. $0.293/hour for Standard_DS3_v2 → ~$213.89/month if on 24/7 |
| Attached disk | per disk-month | The OS/data disk bills per managed-disk tier, including while stopped. |
Sample C3X output
A Standard_DS3_v2 instance left running 24/7 (the avoidable case):
azurerm_machine_learning_compute_instance.dev
└─ Compute instance (Standard_DS3_v2) 730 hours $213.89
Monthly $213.89Optimization tips
Common ways to reduce azurerm_machine_learning_compute_instance cost without changing the workload.
Enable idle shutdown
Up to ~75% on a part-time instanceAn idle-shutdown schedule stops the instance after a period of inactivity — ending the nights-and-weekends billing for an environment nobody's using. An instance used 8 hours a weekday costs roughly a quarter of a 24/7 one.
Right-size the VM size
Large vs an oversized GPU instanceMost ML development runs fine on a DS-series instance. GPU sizes (NC/ND) cost many times more — reserve them for work that genuinely needs the accelerator, not general notebook use.
Train on compute clusters, not the instance
Instance stays small; training scales to zeroHeavy training on a big always-on compute instance pays continuously. An azurerm_machine_learning_compute_cluster scales to zero between jobs and runs the compute only for the job — far cheaper for training.
Use Spot/low-priority for interruptible work
Up to ~90% on interruptible trainingFor fault-tolerant training on clusters, Azure low-priority/Spot VMs run at a deep discount. Keep the interactive instance small and push batch work to discounted cluster capacity.
FAQ
Does an Azure ML compute instance cost money when idle?
Yes — a running instance bills the underlying VM rate whether or not you're using it. Only stopping it ends the compute charge (the disk still bills). Idle running instances are the most common Azure ML waste, just like SageMaker notebooks.
How do I stop paying for an idle instance?
Stop it when not in use, and configure idle_shutdown so Azure ML stops it automatically after an inactivity timeout. That ends overnight and weekend billing — the single biggest saving on a dev instance.
Should I use a compute instance or a compute cluster?
Use a compute instance for interactive development (notebooks, experimentation) and a compute cluster for training jobs — clusters scale to zero between jobs, so you don't pay for idle training capacity. Keep the instance small and push heavy work to the cluster.
How does c3x estimate the cost?
From virtual_machine_size at the VM rate (shown at 24/7 as the ceiling). Real cost depends on running hours — idle shutdown and part-time use bring it well below the ceiling.
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_machine_learning_compute_instance.