Cloud service · Azure · Updated

Service Bus - Azure Service Bus is a managed enterprise message broker that connects applications through durable queues and publish-subscribe topics.

In short

Service Bus decouples producers and consumers so applications can exchange business messages without being available at the same time or processing work at the same rate. It supports asynchronous commands, workload buffering, and event distribution, with capabilities for ordered processing, retries, transactions, and failed-message handling.

Cloud Services Hub →

10 key features of Service Bus

01
Durable queues and competing consumers

Queues buffer work until consumers retrieve it, allowing producers and workers to scale independently. Run multiple consumer instances against the same queue to distribute processing without delivering every message to every instance.

02
Topics, subscriptions, and filtering

Topics distribute messages to independent subscriptions, each with its own processing backlog. Use correlation filters or SQL-style filters on message properties to route events to the appropriate consumers.

03
Explicit message settlement

Peek-Lock receivers complete, abandon, defer, or dead-letter messages according to processing outcomes. Renew locks when necessary and design handlers for redelivery rather than assuming exactly-once execution.

04
Sessions for ordered processing

Sessions provide exclusive, ordered handling of messages sharing a session identifier and can retain session state. Use an order ID or account ID as the session identifier when related operations must be handled sequentially.

05
Duplicate detection

The broker can discard repeated sends with the same MessageId within a configured detection window. This helps with ambiguous send outcomes, but consumers still need idempotency for redelivered messages.

06
Dead-letter queues

Queues and subscriptions have associated dead-letter subqueues for messages that cannot be processed successfully. Record meaningful failure reasons and build an operational process to inspect, correct, and selectively resubmit messages.

07
Scheduling and deferral

Scheduled messages become available at a specified future time. Deferral sets an already received message aside until the application retrieves it by sequence number, so the application must retain that identifier.

08
Broker transactions and autoforwarding

Supported messaging operations can be grouped into a Service Bus transaction, and autoforwarding can chain entities within the same namespace. These transactions do not automatically include external database updates; use an outbox or another consistency pattern for those changes.

09
Identity and network controls

Authorize clients with Microsoft Entra ID roles and managed identities, or use Shared Access Signatures where required. Premium private endpoints provide private connectivity, while Network Security Perimeter can centrally govern supported public-access paths.

10
Premium geographic resilience

Geo-Replication maintains replicas of namespace metadata and message data in secondary regions, including for partitioned Premium namespaces. Plan and test secondary promotion; forced promotion with asynchronous replication can cause message loss or duplication.

Where Service Bus is used

  1. 01
    Background job processing

    An API queues document-generation or image-processing requests and returns before the work finishes. Worker instances consume jobs at a controlled rate, keeping expensive processing off the request path.

  2. 02
    Business event distribution

    Publish an OrderAccepted event to a topic with separate subscriptions for fulfillment, billing, and notifications. Each subsystem processes its own copy independently and can recover from an outage without blocking the others.

  3. 03
    Ordered entity workflows

    Assign the same session identifier to all updates for an individual order or account. A session-aware consumer processes those updates sequentially while other sessions are handled concurrently.

  4. 04
    Hybrid application integration

    On-premises applications and Azure workloads exchange messages through a shared namespace using outbound connectivity or an appropriate private network path. Durable queues allow either side to tolerate temporary disconnection.

  5. 05
    Load leveling for constrained systems

    Buffer requests before a database, partner API, or legacy application with limited throughput. Cap consumer concurrency to protect the downstream system and monitor message age to detect growing processing delays.

  6. 06
    Delayed business actions

    Schedule a payment reminder or an order-expiration check for a future time. Revalidate the current business state when the message is processed because scheduled delivery does not guarantee execution at an exact instant.

How Service Bus is priced

Basic tier

A shared-capacity, operation-based option for queue-only workloads, without a Standard-style base charge. It does not include topics and subscriptions or advanced capabilities such as sessions, transactions, and duplicate detection.

Standard tier

Combines a base charge with metered messaging operations on shared infrastructure. It adds topics, subscriptions, and advanced messaging features; estimate costs from sends, receives, settlement operations, payload size, and the number of subscription copies.

Premium tier

Uses allocated messaging units to provide dedicated processing and memory resources, with capacity-based billing rather than per-operation messaging charges. Size capacity through load testing, account for partitions and regional replicas, and include applicable replication, networking, and data-transfer charges.

Services Service Bus works with

A common architecture places Service Bus between an API and background compute. The API validates a request and sends a small command message; Azure Functions or AKS workers retrieve it, update application state, and complete it only after successful processing. Managed identities authenticate the components through Microsoft Entra ID, with separate sender and receiver roles. Where database changes and message publication must remain consistent, use a transactional outbox rather than assuming a broker transaction covers both systems.

Topics extend this pattern to independent business consumers. Fulfillment workers, notification functions, and Logic Apps workflows can each maintain a subscription, with filters selecting relevant messages. Store large documents in Blob Storage and send references so broker payloads remain small. Align blob retention with retry and dead-letter recovery windows.

Operationally, combine Azure Monitor metrics with application telemetry to track backlog, processing latency, lock failures, and dead-letter growth. For private deployments, verify DNS resolution, compute outbound routing, and connector network support. Regional recovery plans should cover both the messaging namespace and its dependent compute, identity, storage, and downstream systems.

Azure Functions

Service Bus triggers start function executions for messages arriving on queues or topic subscriptions, and output bindings can send messages. For example, a function can process an invoice request and publish a completion event. Configure concurrency, lock renewal, and settlement behavior for the workload, and use managed identity with the required messaging roles.

Logic Apps

Logic Apps provides Service Bus connectors for message-driven integration workflows. For example, a workflow can receive an order message, call an ERP connector, and send a status message to another queue. Connector capabilities and network-access options differ between hosting models, so verify private connectivity and message-settlement behavior before deployment.

Azure Kubernetes Service (AKS)

Applications running on AKS can use Service Bus SDKs to publish and consume messages. For example, fulfillment worker deployments can scale from queue backlog using KEDA. Use Microsoft Entra Workload ID for authentication and tune scaling, prefetch, and consumer concurrency to respect downstream capacity.

Azure Blob Storage

Use the claim-check pattern to keep large payloads in Blob Storage and send a blob reference through Service Bus. For example, store an uploaded document in a private container and enqueue its blob identifier for extraction workers. Coordinate retention and cleanup so blobs remain available through message retries, and use identity-based access rather than long-lived embedded credentials.

Azure Monitor

Azure Monitor collects Service Bus platform metrics and supports diagnostic settings for available resource logs. For example, alert when dead-lettered messages increase, throttled requests appear, or active-message counts remain elevated. Instrument application handlers separately to measure business processing latency and correlate failures with message identifiers.

API Management

Service Bus queues and topics can receive messages directly from an API Management policy. For example, an API can put an order request on a queue using a managed identity and return an acceptance response without waiting for fulfillment.

App Service

Service Bus can trigger App Service WebJobs when a message arrives on a queue or topic subscription. Service Connector can also configure an App Service application's namespace settings and authentication for sending or receiving messages.

Azure Arc

A network-restricted Service Bus namespace can allow eligible Azure Arc traffic through its trusted Microsoft services firewall exception without opening the namespace to general public traffic. The exception does not grant messaging permissions.

Azure Container Apps

Service Bus queue depth or a topic subscription's message backlog can drive scaling for a container app or trigger event-driven Container Apps jobs. For example, a worker app can scale out as orders accumulate and scale back to zero when the queue is empty.

Azure Data Explorer

Service Bus recognizes Azure Data Explorer under its trusted Microsoft services firewall setting. A restricted namespace can allow eligible Azure Data Explorer traffic while still requiring authorization for messaging operations.

Alternatives to Service Bus in other clouds

AWS

Amazon MQAmazon MQ

Amazon MQ and Azure Service Bus are managed message brokers that let applications communicate asynchronously through queues and publish-subscribe topics. Amazon MQ runs ActiveMQ or RabbitMQ broker instances and bills for instance time and storage, while Azure Service Bus offers shared or dedicated capacity and bills for messaging operations or allocated capacity, depending on the tier.

Compare fact by fact
Service BusAmazon MQ
Deployment modelShared or dedicated namespace capacityActiveMQ or RabbitMQ broker instances
Main billing basisOperations or capacity, by tierBroker instance time and storage
Cross-region message replicationPremium namespace replicasActiveMQ primary and replica brokers
Compared Nov 2026
Amazon Simple Notification Service (Amazon SNS)Amazon Simple Notification Service (Amazon SNS)

Amazon SNS and Azure Service Bus both offer managed publish-subscribe messaging to decouple distributed applications. Amazon SNS pushes messages to subscriber endpoints and can filter on message attributes or payloads, while Azure Service Bus receivers retrieve messages from subscription backlogs and subscription filters evaluate message properties only.

Compare fact by fact
Service BusAmazon Simple Notification Service (Amazon SNS)
Topic deliveryReceivers pull from subscriptionsPush to subscriber endpoints
Topic billingStandard: base + usage; Premium: unitsUsage-based, no base charge
Subscription filtersMessage properties onlyMessage attributes or payload
Ordered processingSessions keyed by session IDFIFO topics to SQS FIFO queues
Amazon Simple Queue Service (Amazon SQS)Amazon Simple Queue Service (Amazon SQS)

Amazon SQS and Azure Service Bus provide managed queues that let applications exchange messages asynchronously. Amazon SQS meters API requests and uses FIFO queues for ordered processing, while Azure Service Bus meters operations or bills for dedicated capacity depending on the tier and uses sessions to order related messages.

Compare fact by fact
Service BusAmazon Simple Queue Service (Amazon SQS)
Billing modelOperations, base + ops, or capacityPer billable API request
Ordered processingSessions on Standard or PremiumFIFO queues
What happens on receiptPeek-Lock or Receive-and-DeleteMessage hidden; delete after processing
Delayed deliveryScheduled for a future timeRelative delay up to 15 minutes

What is Service Bus

2 min read

Azure Service Bus provides durable asynchronous messaging for distributed applications, microservices, and hybrid systems. Applications send messages to entities within a namespace, and receivers retrieve them when they have capacity to process them. This separates application availability from downstream processing availability and lets a queue absorb temporary traffic spikes. Service Bus is intended for business messaging rather than analytical event streaming or long-term message archiving.

A queue distributes work among competing consumers. Each message is processed by one consumer at a time, although it can be delivered again after a processing or settlement failure. A topic supports publish-subscribe messaging through independent subscriptions. Each subscription receives matching messages and maintains its own backlog. Subscription filters evaluate message properties, not message bodies, so producers should place routing attributes such as event type, tenant identifier, or business region in application properties.

Use Peek-Lock receive mode when messages must survive consumer failures. The receiver temporarily locks a message, performs its work, and completes the message after successful processing. Abandoning the message or allowing its lock to expire makes it eligible for redelivery. Configure lock renewal for longer-running handlers, and make business operations idempotent because successful processing followed by a failed completion can cause duplicate execution. Receive-and-Delete removes messages as they are delivered and is appropriate only when message loss is acceptable.

Sessions support ordered handling of related messages using a shared session identifier. Ordering applies within a session rather than globally across all consumers. Duplicate detection suppresses repeated sends with the same message identifier within a configured window, but it does not provide end-to-end exactly-once processing. Dead-letter queues isolate messages that exceed delivery attempts or are explicitly rejected. Applications need monitoring, inspection, and controlled replay procedures because dead-lettered messages are not automatically repaired or reprocessed.

Choose Basic for straightforward queue workloads, Standard for shared-capacity messaging with topics and advanced broker features, and Premium when dedicated resources or Premium-specific networking and resilience capabilities are required. Check message-size, entity-capacity, connection, and throughput quotas before deployment. Reuse SDK clients and connections, batch sends where appropriate, and tune prefetch and concurrency against processing duration so prefetched messages do not exhaust their locks before handling begins.

Prefer Microsoft Entra ID authentication with managed identities and narrowly scoped data-plane roles. Premium supports private endpoints for private network access; private DNS and application routing must also be configured. For regional recovery, Premium Geo-Replication replicates message data and metadata and supports partitioned namespaces. Do not confuse it with Geo-Disaster Recovery, which replicates entity metadata only. Test promotion and client recovery procedures, and select replication settings according to acceptable data loss and latency. Monitor backlog growth, dead-letter counts, throttling, and application processing latency as part of normal operations.

Azure architecture icons are the property of Microsoft. BlowStack is not affiliated with or endorsed by Microsoft.

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.