azurerm_ eventhub cost estimation
An individual event hub (partitioned log) inside an Event Hubs namespace. The hub itself is free. Cost lives on the parent namespace: throughput units, processing units, or dedicated capacity, plus ingress events and Capture.
The azurerm_
The pricing model depends on the namespace tier. Basic and Standard bill per Throughput Unit (TU), where one TU allows 1 MB/s or 1,000 events/s of ingress and twice that egress. Basic TUs run about $0.015/hour (roughly $11/month) and Standard TUs about $0.03/hour (roughly $22/month). Standard also charges ingress events at $0.028 per million events beyond what the TU covers. Premium bills per Processing Unit (PU) at roughly $1.10/hour (about $803/month per PU) with resource isolation. Dedicated bills per Capacity Unit at roughly $6.85/hour (about $5,000/month) for the highest scale and single-tenant isolation.
Two hub-level settings quietly drive cost even though the hub is free. Partition count sets the ceiling on parallel consumers and cannot be lowered after creation on most tiers, so over-provisioning partitions locks in a shape you may later pay to work around. Message retention holds events in the hub, and on Standard, longer retention windows and the Capture feature that archives events to Blob or Data Lake add cost. Capture on Standard runs about $0.10/hour per TU (roughly $73/month per TU) on top of the TU charge, plus the storage account it writes to.
The cost-adjacent gotcha is auto-inflate. A Standard namespace with auto-inflate enabled will silently scale TUs up under load and bill for them, but never scales back down, so a traffic spike can leave you paying for 20 TUs long after the spike passed. Set a sane maximum and audit the current TU count.
c3x flags azurerm_
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "azurerm_eventhub_namespace" "main" {
name = "orders-ns"
location = "eastus"
resource_group_name = azurerm_resource_group.main.name
sku = "Standard"
capacity = 2
auto_inflate_enabled = true
maximum_throughput_units = 5
}
resource "azurerm_eventhub" "orders" {
name = "orders"
namespace_name = azurerm_eventhub_namespace.main.name
resource_group_name = azurerm_resource_group.main.name
partition_count = 4
message_retention = 1
capture_description {
enabled = true
encoding = "Avro"
destination {
name = "EventHubArchive.AzureBlockBlob"
blob_container_name = "captures"
storage_account_id = azurerm_storage_account.capture.id
archive_name_format = "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"
}
}
}Pricing dimensions
What you actually pay for when you provision azurerm_.
| Dimension | Unit | What's being charged |
|---|---|---|
| Event hub | free | The event hub entity, its partitions, and consumer groups carry no per-resource charge. $0 (free) |
| Standard throughput unit | per hour | Namespace capacity on the Standard tier. One TU covers 1 MB/s or 1,000 events/s ingress. $0.03/hour per TU (about $22/month) |
| Ingress events (Standard) | per million events | Charged on the Standard tier for events published beyond the throughput unit allowance. $0.028 per million events |
| Capture (Standard) | per hour | Optional archival of events to Blob or Data Lake, billed per TU on top of the TU charge, plus the storage it writes. $0.10/hour per TU (about $73/month) |
| Premium processing unit | per hour | Resource-isolated capacity on the Premium tier, an alternative to throughput units. $1.10/hour per PU (about $803/month) |
| Dedicated capacity unit | per hour | Single-tenant Dedicated cluster capacity for the highest scale workloads. $6.85/hour per CU (about $5,000/month) |
Optimization tips
Common ways to reduce azurerm_ cost without changing the workload.
Cap auto-inflate and audit the current TU count
$22/month per stranded TUAuto-inflate scales throughput units up under load but never scales them back down. Set maximum_
Consolidate hubs into one namespace
$22+/month per avoided namespace TUThroughput units are billed at the namespace level and shared across every hub in it. One namespace with several hubs sharing 2 TUs is far cheaper than several namespaces each holding their own TUs.
Right-size partition count before creation
Partition count is fixed after creation on Basic and Standard. Set it to your realistic peak consumer parallelism, not the maximum, to avoid paying later to migrate to a new hub with a different shape.
Only enable Capture where you truly need archival
$73/month per TUCapture adds roughly $73/month per TU plus storage. If a downstream consumer already persists events to a data lake, Capture is duplicate spend.
FAQ
Why is the event hub free but my Event Hubs bill is not?
Azure bills the namespace, not the individual hub. Throughput units, processing units, dedicated capacity, ingress events, and Capture all attach to the parent azurerm_
Does adding partitions or consumer groups cost more?
No. Partitions and consumer groups are free structural settings. They affect parallelism and consumer design, not the invoice. The only cost lever they touch indirectly is that more parallel consumers can drive higher egress, which counts against your throughput units.
What is the cheapest way to run a low-volume event hub?
Basic tier at roughly $0.015/hour per throughput unit (about $11/month) if you only need short retention and do not need Capture, Kafka protocol, or consumer group flexibility. Standard is the common choice once you need those features.
How much does Event Hubs Capture cost?
On Standard, Capture is about $0.10/hour per throughput unit, roughly $73/month per TU, charged on top of the TU itself. You also pay for the Blob or Data Lake storage account it writes the Avro files to.
Related resources
More Azure resources
Further reading
- Azure Event Hubs cost: throughput units vs Premium and Dedicated
Event Hubs Standard bills throughput units by the hour plus per-million ingress events; Premium and Dedicated allocate reserved capacity. Under-provision throughput units and you throttle; over-provision and you overpay. Here is how to size it.
- Azure Event Hubs vs Service Bus cost: streaming vs messaging pricing
Event Hubs prices by throughput units for high-volume streaming, while Service Bus prices by operations and messaging units for enterprise messaging. They solve different problems at very different cost curves. Here is how to compare them.
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_.