AzureAzure Container InstancesContainers

azurerm_container_group cost estimation

Serverless containers billed per vCPU-second and GB-second, only while running. 1 vCPU + 1.5 GB run 24/7 is ~$28/month; scale-to-zero workloads cost far less.

An azurerm_container_group runs one or more containers on Azure Container Instances (ACI) — serverless containers with no cluster or VMs to manage. Cost is per-second: ~$0.0000113/vCPU-second and ~$0.0000118/GB-second of memory, billed only while the container group is running. A 1 vCPU + 1.5 GB group running around the clock is ~$23.11 (vCPU) + $4.65 (memory) ≈ $27.75/month.

The per-second model is the whole appeal: for short-lived or bursty work — batch jobs, build agents, event-driven tasks, per-request containers — you pay only for the seconds the container actually runs, which can be cents. A group that runs a 5-minute job a few times a day costs almost nothing. The flip side: a container group left running continuously bills the full ~$28/month (per vCPU+memory), and for steady always-on workloads, AKS or Container Apps are usually cheaper per unit.

The cost is driven entirely by allocated vCPU/memory × runtime. The levers: right-size the container's CPU and memory requests (cost scales linearly), stop/delete groups when their work is done rather than leaving them running, and use ACI for spiky/transient work — not as a cheap always-on host.

c3x prices the group from its cpu and memory allocation × runtime, so the cost is visible before deployment.

Terraform example

A minimal but realistic configuration that C3X can estimate.

resource "azurerm_container_group" "job" {
  name                = "batch-job"
  location            = azurerm_resource_group.main.location
  resource_group_name = azurerm_resource_group.main.name
  os_type             = "Linux"
  restart_policy      = "Never"

  container {
    name   = "worker"
    image  = "myregistry.azurecr.io/worker:latest"
    cpu    = 1
    memory = 1.5
  }
}

Pricing dimensions

What you actually pay for when you provision azurerm_container_group.

DimensionUnitWhat's being charged
Container vCPUper vCPU-secondAllocated vCPU billed per second while the group runs. (The upstream meter is per 100 seconds.)
~$0.0000113/vCPU-second → 1 vCPU 24/7 ≈ $23.11/month
Container memoryper GB-secondAllocated memory billed per second while the group runs.
~$0.0000118/GB-second → 1.5 GB 24/7 ≈ $4.65/month

Sample C3X output

A 1 vCPU + 1.5 GB container group running 24/7:

azurerm_container_group.job
├─ Container vCPU     1 vCPU × 730h     $23.11
└─ Container memory   1.5 GB × 730h      $4.65
                      Monthly           $27.75

Optimization tips

Common ways to reduce azurerm_container_group cost without changing the workload.

Use ACI for spiky/transient work, not always-on

Up to ~95% for transient vs always-on

The per-second model shines for short-lived jobs, build agents, and event-driven tasks — pay only for seconds run. A container group left running 24/7 bills the full ~$28/month per vCPU+memory; for steady workloads, AKS or Container Apps are cheaper per unit.

Right-size CPU and memory

Proportional to the cut

Cost scales linearly with the cpu and memory you allocate per container. Many groups are over-allocated 'to be safe'; halving the request halves the bill for that container.

Stop or delete groups when done

Full cost during idle periods

Billing stops when the group stops. For job-style workloads use restart_policy = Never and delete the group after completion, rather than leaving idle containers running.

Consider Spot container groups for fault-tolerant work

Large on Spot-eligible jobs

ACI offers Spot pricing (priority = Spot) at a deep discount for interruptible workloads — batch and CI tasks that tolerate eviction.

FAQ

How are Azure Container Instances billed?

Per second of allocated vCPU and memory while the container group runs — ~$0.0000113/vCPU-second and ~$0.0000118/GB-second. A 1 vCPU + 1.5 GB group running 24/7 is ~$27.75/month; a short job costs cents. You pay for runtime, not a provisioned host.

Is ACI cheaper than AKS or Container Apps?

For short-lived, bursty, or event-driven work, yes — per-second billing with no idle cost. For steady, always-on containers, AKS (node VMs) or Container Apps (scale-to-zero with sustained-use efficiency) are usually cheaper per unit. ACI is for transient work.

How does c3x estimate the cost?

From the container's cpu and memory allocation × runtime, at the per-second vCPU and GB rates. The sample assumes 24/7; transient workloads that stop when done cost far less.

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