AzureAzure Event HubsAnalytics

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_eventhub resource creates a single event hub, which is the Kafka-topic-equivalent partitioned log that producers write to and consumers read from. Creating a hub costs nothing. Azure never bills per hub, per partition, or per consumer group. What you pay for is the parent azurerm_eventhub_namespace, which is where the tier, capacity, and data-plane charges are decided.

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_eventhub as free and attributes throughput, ingress, and Capture cost to the namespace so you see where the real spend sits.

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

DimensionUnitWhat's being charged
Event hubfreeThe event hub entity, its partitions, and consumer groups carry no per-resource charge.
$0 (free)
Standard throughput unitper hourNamespace 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 eventsCharged on the Standard tier for events published beyond the throughput unit allowance.
$0.028 per million events
Capture (Standard)per hourOptional 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 unitper hourResource-isolated capacity on the Premium tier, an alternative to throughput units.
$1.10/hour per PU (about $803/month)
Dedicated capacity unitper hourSingle-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_eventhub cost without changing the workload.

Cap auto-inflate and audit the current TU count

$22/month per stranded TU

Auto-inflate scales throughput units up under load but never scales them back down. Set maximum_throughput_units to a defensible number and periodically check the live TU count so a past traffic spike is not still on your bill.

Consolidate hubs into one namespace

$22+/month per avoided namespace TU

Throughput 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 TU

Capture 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_eventhub_namespace. You can create many hubs in one namespace at no extra per-hub cost.

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

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.