Skip to Content
IntegrationsAzure Service Bus

Azure Service Bus

Collection SERVICE_BUS_RECEIVER and Delivery SERVICE_BUS_SEND, over Azure Service Bus AMQP 1.0: queues, topics and subscriptions. For Azure Event Hubs, use the Apache Kafka connector pointed at the Event Hubs Kafka endpoint.

On the Connections screen, the Azure Service Bus type sits in the Messaging category, next to Apache Kafka and RabbitMQ.

CMS does not create queues, topics or subscriptions. The entities belong to whoever administers the namespace in Azure. The Collection reads from a queue (or subscription) that already exists, and the Delivery sends to a queue or topic that already exists.

Connection

Azure Service Bus connection: authentication, connection string and test entity
Azure Service Bus connection: authentication, connection string and test entity
Azure Service Bus connection: authentication, connection string and test entity
FieldWhat it is for
AuthenticationConnection string (Shared access policy) or Microsoft Entra ID (app registration)
Connection stringThe Primary Connection String of a Shared access policy: Endpoint=sb://empresa.servicebus.windows.net/;SharedAccessKeyName=...;SharedAccessKey=.... It is stored encrypted in the database — it is the credential
NamespaceEntra ID only: empresa.servicebus.windows.net
Tenant ID / Client ID / Client secretEntra ID only: the app registration. It needs the Azure Service Bus Data Sender (Delivery) and/or Data Receiver (Collection) role on the namespace
Test entityOptional. Queue (or topic/subscriptions/subscription) that Test Connection peeks at when the credential cannot list the entities
Timeout (ms)Maximum time of each operation. Default 30000

Listing queues and topics requires the Manage permission on the policy (or the Data Owner role in Entra ID). With it, the Collection and Delivery magnifiers offer the list. Without it, everything works — you just type the names, and Test Connection uses the Test entity: it peeks at one message from it, which proves address and credential without consuming anything.

Test Connection says the namespace and how many queues and topics it sees (or confirms reading the test entity). A Collection going down raises the Azure Service Bus connection lost alert.

Collection — SERVICE_BUS_RECEIVER

FieldWhat it is for
Queue or topicA queue that already exists — or, with Subscription filled in, the topic. The magnifier lists queues and subscriptions; picking a subscription fills both fields. Accepts a {{NAME}} Variable, resolved when the Collection starts
SubscriptionEmpty = reads the queue. Filled in = reads that subscription of the topic
Read the dead-letter queueReads the entity’s dead-letter queue instead of the main one — to reprocess what Service Bus has already given up delivering
Include metadataOn, the message becomes {entity, subscription, messageId, correlationId, subject, contentType, sessionId, sequenceNumber, enqueuedTime, deliveryCount, applicationProperties, body}; off, it is just the body. The metadata is recorded under “Sent” either way

Two CMS Collections on the same queue (or subscription) of the same namespace are refused: the messages would be split between them, and each would see only part. A queue or subscription with sessions is not supported in the Collection.

Completed only after storing

The Collection uses peek-lock mode: CMS stores one message at a time, in order, and only completes it (complete) on Service Bus after it is stored. If the CMS database goes down, the Collection holds the message — the lock is renewed — and tries again; if it cannot within a few minutes, it returns the message to the queue (abandon) and its deliveryCount goes up. If Service Bus goes down, the Collection reconnects on its own. A failure between storing and completing makes the message arrive again: use the messageId from the metadata to drop duplicates.

Delivery — SERVICE_BUS_SEND

FieldWhat it is for
Queue or topicDestination, which must already exist. The magnifier lists queues and topics. Accepts {{alias}}; an empty value is an error
SubjectThe message subject (label), with {{alias}} — subscriptions usually filter on it
Session idRequired when the queue or subscription requires sessions (order guaranteed per key, e.g. the equipment). Accepts {{alias}}
Properties (JSON)Application properties as {"name": "value"}; the value accepts {{alias}}

The Delivery is only considered done when Service Bus accepts the message. The messageId is always the CMS message id — a retry repeats the same one, and Service Bus duplicate detection (when enabled on the queue) drops the repeat.

What resolves against the input payload

Queue/topic, subject, session and properties resolve {{alias}} against the input payload, before the Transformer. Only the body sent is the transformed one. It is the same rule as Kafka and RabbitMQ.

Common errors

MessageLikely cause
“Invalid Service Bus connection string”SharedAccessKey is missing — copy the whole Primary Connection String from the policy
“Service Bus refused the credentials”Wrong or regenerated key; with Entra ID, expired secret or missing role on the namespace
“Queue/topic … does not exist in the namespace”Wrong name, or entity not created yet — CMS does not create it
“The credential has no permission to manage the namespace”Policy without Manage: type the name, or fill in Test entity
“Queue/subscription … requires sessions”Fill in the Session id in the Delivery
“The message exceeded the maximum size”256 KB on the Standard tier; 100 MB on Premium
“Could not connect to Service Bus”Wrong namespace or firewall: open port 5671 (AMQP) and 443
”… with an empty value in …”The alias is not in the input payload (before the Transformer) nor a Variable

Testing in the Test Bench

In the Test Bench, the Publish to source mode sends the payload to the Collection’s queue — or to the topic, when it reads a subscription — and lets the Collection react through the normal path.