azurerm_eventhub_namespace cost estimation
A Kafka-compatible event streaming platform. Tier-based pricing (Basic, Standard, Premium, Dedicated) with throughput units or processing units.
An azurerm_eventhub_namespace is the container for Azure Event Hubs (Kafka-compatible event streaming). Pricing varies dramatically by tier.
Basic tier: $0.015/hour per Throughput Unit (TU). Each TU provides 1 MB/s ingress, 2 MB/s egress, 100K events/sec. Limited to 1 day retention. Single consumer group. Right for dev/test only.
Standard tier: $0.030/hour per TU. Same TU capacity but 1-7 day retention, multiple consumer groups, Kafka protocol support. The default for production. A 5-TU namespace costs $109/month.
Premium tier: $1.094/hour per Processing Unit (PU). Larger ingestion (up to 5 MB/s per PU), 90-day retention, schema registry, customer-managed keys. Per-PU pricing is much higher; right for high-throughput workloads with compliance needs.
Dedicated tier: per-Capacity-Unit (CU) pricing at ~$11/hour. Self-contained dedicated cluster. Right for enterprises with very high throughput (>20 MB/s sustained).
Capture (saving events to Blob Storage or Data Lake): adds $0.10/TU-hour on top of base price. Common for event sourcing patterns.
Capture egress: standard Azure egress applies to bytes saved.
Schema Registry (Premium only): free as a feature, but counts toward Premium PU pricing.
Compared to AWS MSK: MSK has cheaper per-throughput pricing but requires broker management. Event Hubs is fully serverless with no broker concept. For variable workloads, Event Hubs Standard is usually cheaper than MSK Serverless.
c3x reads sku, capacity (TUs for Basic/Standard, PUs for Premium), and capture configuration from the resource.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "azurerm_eventhub_namespace" "events" {
name = "production-events"
location = "eastus"
resource_group_name = azurerm_resource_group.main.name
sku = "Standard"
capacity = 5
auto_inflate_enabled = true
maximum_throughput_units = 20
tags = {
Environment = "production"
}
}
resource "azurerm_eventhub" "orders" {
name = "orders"
namespace_name = azurerm_eventhub_namespace.events.name
resource_group_name = azurerm_resource_group.main.name
partition_count = 4
message_retention = 7
capture_description {
enabled = true
encoding = "Avro"
interval_in_seconds = 300
destination {
name = "EventHubArchive.AzureBlockBlob"
archive_name_format = "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"
blob_container_name = azurerm_storage_container.events.name
storage_account_id = azurerm_storage_account.events.id
}
}
}Pricing dimensions
What you actually pay for when you provision azurerm_eventhub_namespace.
| Dimension | Unit | What's being charged |
|---|---|---|
| Basic tier TU-hours | per TU per hour | 1 MB/s ingress, 2 MB/s egress per TU. Dev/test only. $0.015/TU-hour |
| Standard tier TU-hours | per TU per hour | Standard production tier with Kafka protocol. $0.030/TU-hour ≈ $21.90/TU/month |
| Premium tier PU-hours | per PU per hour | Larger ingestion per unit, 90-day retention, schema registry. $1.094/PU-hour ≈ $799/PU/month |
| Dedicated tier | per CU per hour | Dedicated cluster for very high throughput. ~$11/hour |
| Capture egress | per TU-hour additional | If Capture (auto-save to Blob/Data Lake) is enabled, billed per TU-hour on top of base. $0.10/TU-hour |
Optimization tips
Common ways to reduce azurerm_eventhub_namespace cost without changing the workload.
Use auto-inflate to scale TU count
Off-peak savingsSetting auto_inflate_enabled = true and maximum_throughput_units lets the namespace scale up to a cap. Bills the highest TU count of the day. Cheaper than provisioning for peak.
Right-size TU count to actual throughput
$22/month per TU droppedEach TU is 1 MB/s ingress. If you're consistently below 50% utilization, drop a TU. Use Event Hubs metrics in Azure Monitor.
Use Standard, not Premium, unless features required
97% on equivalent throughputPremium is 36x more per unit. Only justified if you need >7 day retention, schema registry, customer-managed keys, or VNet integration. For standard event streaming, Standard tier is right.
Capture to Blob, not Data Lake, if both work
Downstream storageCapture egress is the same per-TU-hour rate, but downstream storage costs differ. Blob Storage Standard is cheaper than Data Lake for archive-style usage.
FAQ
Event Hubs or MSK?
Event Hubs is fully serverless: no broker management, scaling is just changing TU count. MSK exposes Kafka brokers you manage. Event Hubs Standard is usually cheaper for sub-50 MB/s sustained throughput. MSK becomes cost-effective at higher sustained throughput with reserved instances.
What about Event Hubs for Kafka?
Standard and Premium tiers support the Kafka protocol natively. Applications using Kafka client libraries work without changes. Pricing is the same as for the native Event Hubs API.
Does c3x include Capture cost?
Yes if capture_description is configured. The per-TU-hour capture fee is added to the base TU cost. Downstream storage in Blob or Data Lake is estimated as separate resources.
How do partitions affect cost?
Partitions don't have a direct per-partition cost. The TU/PU count determines throughput capacity; partitions are how you distribute that capacity across consumers. More partitions = more parallel consumer capacity but no extra 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_eventhub_namespace.