azurerm_servicebus_queue cost estimation
A Service Bus queue is free to declare; its cost is billed on the parent namespace. The namespace tier (Basic, Standard, or Premium) sets whether you pay per operation or per messaging unit.
An azurerm_servicebus_queue is a first-in, first-out message queue with at-least-once delivery, sessions, dead-lettering, and duplicate detection, hosted inside a Service Bus namespace. Declaring the queue is free. All charges land on the parent azurerm_servicebus_namespace, and the namespace tier determines the pricing model.
On the Basic and Standard tiers, cost is per operation: a base monthly charge for the namespace (Standard) plus a per-million-operations charge for messaging operations against the queue, where each send and receive counts, and brokered connections beyond the included quota add cost. Standard adds features like topics and sessions that Basic lacks. On the Premium tier, you buy dedicated capacity as messaging units (1, 2, 4, 8, or 16), billed hourly regardless of message volume, which gives predictable performance and isolation for high-throughput or latency-sensitive workloads. The queue itself carries no separate line; it inherits whichever model the namespace uses.
The optimization is tier choice and operation efficiency: stay on Standard and batch sends and receives to cut per-operation cost, or move to Premium only when throughput, predictable latency, or isolation justify the fixed messaging-unit charge. Prefetching and batching reduce the receive operations that drive Standard-tier cost. c3x prices the parent namespace and its tier and treats the queue 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_queue" "orders" {
name = "orders"
namespace_id = azurerm_servicebus_namespace.main.id
max_delivery_count = 10
lock_duration = "PT1M"
dead_lettering_on_message_expiration = true
}Pricing dimensions
What you actually pay for when you provision azurerm_servicebus_queue.
| Dimension | Unit | What's being charged |
|---|---|---|
| Queue declaration | free | Creating the queue has no charge; cost is billed on the parent namespace by its tier. $0 |
| Messaging operations (Basic/Standard) | per million operations | Each send and receive against the queue counts as a messaging operation 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 volume. |
Optimization tips
Common ways to reduce azurerm_servicebus_queue cost without changing the workload.
Batch sends and receives on Standard
Standard tier bills per messaging operation. Sending and receiving messages in batches reduces the operation count for the same throughput.
Use prefetch to cut receive operations
Prefetching pulls several messages in one operation instead of one call per message, lowering the receive operations that drive Standard-tier cost.
Move to Premium only when justified
Premium's fixed messaging-unit charge pays off for high, steady throughput or strict latency needs. For bursty or low-volume workloads, Standard's per-operation model is cheaper.
FAQ
Does a Service Bus queue cost money?
The queue is free to declare. Cost is billed on the parent namespace: per-operation on Basic and Standard, or per messaging unit per hour on Premium. The queue inherits the namespace's pricing model.
What is the difference between Standard and Premium cost?
Standard bills a base fee plus per-million operations, so cost scales with message volume. Premium buys fixed messaging units billed hourly for dedicated capacity and predictable latency, independent of volume.
How do I lower Service Bus queue cost?
On Standard, batch sends and receives and use prefetch to reduce metered operations. Choose Premium only when steady high throughput or latency guarantees justify its fixed hourly charge.
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_queue.