azurerm_ container_ app cost estimation
Serverless containers billed by active vCPU-seconds and GiB-seconds. An always-on 0.5 vCPU / 1 GiB replica is ~$39/month; scale-to-zero apps cost far less.
An azurerm_
That makes the cost entirely a function of how long replicas run × how big they are. A single 0.5 vCPU / 1 GiB replica left running 24/7 is about $39/month. The same app with scale-to-zero (min_
The cost surprises come from two directions. First, min_
Container Apps also bills a separate environment (azurerm_
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "azurerm_container_app" "api" {
name = "api"
container_app_environment_id = azurerm_container_app_environment.main.id
resource_group_name = azurerm_resource_group.main.name
revision_mode = "Single"
template {
min_replicas = 0
max_replicas = 10
container {
name = "api"
image = "myregistry.azurecr.io/api:latest"
cpu = 0.5
memory = "1Gi"
}
}
ingress {
external_enabled = true
target_port = 8080
traffic_weight {
percentage = 100
latest_revision = true
}
}
}Pricing dimensions
What you actually pay for when you provision azurerm_.
| Dimension | Unit | What's being charged |
|---|---|---|
| Active vCPU usage | per vCPU-second | vCPU allocated to running replicas, per second of activity, after the monthly free grant. ~$0.000024/vCPU-second active |
| Active memory usage | per GiB-second | Memory allocated to running replicas, per second of activity, after the monthly free grant. ~$0.000003/GiB-second active |
| Requests | per million | Per-request charge after the free monthly grant. Usually a rounding error next to resource-seconds. |
Sample C3X output
One always-on 0.5 vCPU / 1 GiB replica (min_replicas ≥ 1) for the month:
azurerm_container_app.api
├─ vCPU active usage 0.5 vCPU × 730h $30.46
└─ Memory active usage 1 GiB × 730h $8.96
Monthly $39.42Optimization tips
Common ways to reduce azurerm_ cost without changing the workload.
Set min_ replicas = 0 for anything that can scale to zero
Up to ~95% for spiky/low-traffic appsScale-to-zero is the whole point of Container Apps. An HTTP app with min_
Right-size CPU and memory requests
Proportional to the cutCost scales linearly with the cpu and memory you request per container. Many apps are over-allocated 'to be safe' at 1 to 2 vCPU when 0.25 to 0.5 is plenty. Halving the request halves the compute line.
Keep min_ replicas low and let max_ replicas absorb spikes
One+ replica-month per lowered floorYou pay for replicas that run, so a floor of 1 plus a generous max gives availability without paying for peak capacity around the clock. Reserve min_
Use a dedicated workload profile only at sustained scale
Workload-dependentThe Consumption plan is cheapest for variable load. Dedicated workload profiles make sense only when an app runs large and steady enough that reserved capacity beats per-second billing, measure before switching.
FAQ
How is Azure Container Apps billed?
On the Consumption plan, by active resource-seconds: vCPU-seconds and GiB-seconds your replicas use while running, plus a per-request charge, after a monthly free grant. You pay for what runs, not for provisioned nodes.
Does an idle Container App cost anything?
With min_
Why is my Container App more expensive than expected?
Usually min_
How does c3x estimate a Container App?
From template_
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_.