azurerm_servicebus_topic cost estimation
A Service Bus topic is free to declare; its cost is billed on the parent namespace. Publish-subscribe fan-out means each subscription that receives a message adds a metered operation.
An azurerm_servicebus_topic is the publish-subscribe counterpart to a queue: a publisher sends one message to the topic, and every subscription attached to it receives a copy filtered by its rules. Topics require the Standard or Premium tier (Basic does not support them). Declaring the topic is free; all charges land on the parent azurerm_servicebus_namespace.
The pricing model is the namespace's. On Standard, cost is a base monthly fee plus per-million messaging operations, and the fan-out matters: a single publish to a topic with several subscriptions generates a receive operation for each subscription that delivers the message, so the operation count scales with the number of active subscriptions, not just the publish rate. On Premium, you buy messaging units billed hourly for dedicated capacity, and the fan-out affects throughput rather than a per-operation bill. Subscription filters that drop messages early can reduce unnecessary deliveries and therefore operations on Standard.
The optimization is to keep fan-out purposeful: use subscription filters so only interested subscribers receive a message, batch publishes, and avoid idle subscriptions that still receive and require draining. c3x prices the parent namespace and its tier and treats the topic declaration as free.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "azurerm_resource_group" "main" {
name = "messaging-rg"
location = "eastus"
}
resource "azurerm_servicebus_namespace" "main" {
name = "app-sb-2026"
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
sku = "Standard"
}
resource "azurerm_servicebus_topic" "events" {
name = "events"
namespace_id = azurerm_servicebus_namespace.main.id
default_message_ttl = "P14D"
}Pricing dimensions
What you actually pay for when you provision azurerm_servicebus_topic.
| Dimension | Unit | What's being charged |
|---|---|---|
| Topic declaration | free | Creating the topic has no charge; cost is billed on the parent namespace by its tier. $0 |
| Messaging operations (Standard) | per million operations | A publish plus a delivery to each subscription counts as messaging operations on the namespace. ~$0.80 per million operations (Standard), plus a Standard base fee |
| Messaging units (Premium) | per hour | Premium namespaces buy dedicated capacity in messaging units, billed hourly regardless of fan-out. |
Optimization tips
Common ways to reduce azurerm_servicebus_topic cost without changing the workload.
Filter subscriptions to cut needless deliveries
Subscription filters drop messages a subscriber does not care about before delivery, reducing the per-subscription receive operations that drive Standard-tier cost on a fan-out topic.
Remove idle subscriptions
Every subscription on a topic receives a copy of matching messages and must be drained. Deleting unused subscriptions removes the operations they would otherwise generate.
Batch publishes and use Premium for steady fan-out
Batching publishes lowers operation count on Standard. For high, steady fan-out throughput, Premium's fixed messaging-unit charge can be cheaper than per-operation billing.
FAQ
Does a Service Bus topic cost money?
The topic is free to declare. Cost is billed on the parent namespace: per-million operations on Standard or per messaging unit per hour on Premium. Topics are not available on the Basic tier.
Why does a topic cost more than a queue?
Fan-out. A single publish is delivered to every subscription, and on Standard each delivery is a metered operation, so a topic with many subscriptions generates more operations than a single queue.
How do I reduce Service Bus topic cost?
Use subscription filters so only interested subscribers receive messages, delete idle subscriptions, and batch publishes. On steady high-throughput fan-out, Premium's fixed capacity may be cheaper.
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_servicebus_topic.