azurerm_image cost estimation
A custom VM image stored as managed-disk snapshots, billed per GB-month. A 127 GB image is ~$6.35/month.
An azurerm_image is a custom virtual machine image — a generalized capture of a VM's OS (and optionally data) disks used to deploy new VMs. It's stored as managed-disk content and bills per GB-month at the snapshot/standard storage rate (~$0.05/GB-month), based on the image's disk size. A standard 127 GB Windows/Linux OS image is ~$6.35/month.
It's an inexpensive resource on its own, but image cost accumulates the same way snapshots do: teams build a new image on every release and never delete the old ones, so dozens of versioned images pile up storage. Each is the full disk size, so the cost grows linearly with how many image versions you retain.
The levers are straightforward retention hygiene: keep only the image versions you might roll back to or deploy from, delete superseded ones, and consider Azure Compute Gallery (Shared Image Gallery) for managing image versions with replication — though replication to multiple regions multiplies the storage cost, so replicate only where you deploy.
c3x prices the image from its storage size, so the per-image cost is visible — and the multiplier across retained versions becomes clear.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "azurerm_image" "golden" {
name = "app-golden-image"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
os_disk {
os_type = "Linux"
os_state = "Generalized"
blob_uri = var.source_vhd_uri
size_gb = 127
}
}Pricing dimensions
What you actually pay for when you provision azurerm_image.
| Dimension | Unit | What's being charged |
|---|---|---|
| Image storage | per GB-month | Stored at the managed-disk/snapshot rate based on the image's disk size. Each retained version stores the full size. $0.05/GB-month → 127 GB ≈ $6.35/month |
Sample C3X output
A 127 GB custom OS image:
azurerm_image.golden
└─ Image storage 127 GB-month $6.35
Monthly $6.35Optimization tips
Common ways to reduce azurerm_image cost without changing the workload.
Delete superseded image versions
Per retained version removedBuilding a new image per release and never deleting old ones is how image storage creeps. Keep only versions you might deploy or roll back to, and prune the rest — each stores the full disk size.
Replicate gallery images only where you deploy
Per unneeded replica regionAzure Compute Gallery manages image versions with regional replication, but each replica is a full copy. Replicate only to regions you actually deploy into, not all of them.
Right-size the source disk
Proportional to disk sizeImage cost tracks the disk size. Building images from right-sized OS disks (not bloated ones) keeps every stored version smaller.
FAQ
How is an Azure VM image billed?
Per GB-month at the managed-disk/snapshot storage rate (~$0.05/GB-month), based on the image's disk size — a 127 GB image is ~$6.35/month. Each retained image version stores the full disk size.
Why is my image storage cost growing?
Retention. Teams build a new image per release and rarely delete old ones, so versioned images accumulate at the full disk size each. Prune superseded versions and, for gallery images, replicate only to regions you deploy in.
How does c3x estimate the cost?
From the image's storage size at the per-GB-month rate. Multiply by the number of versions you retain to see the true accumulated cost.
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_image.