-
-
Notifications
You must be signed in to change notification settings - Fork 41
Service Bus Subscribers
Paul Mcilreavy edited this page Dec 22, 2025
·
2 revisions
Service Bus subscribers deliver events to Azure Service Bus queues or topics.
| Setting | Description |
|---|---|
name |
The name of the subscriber. |
connectionString |
The Service Bus connection string. Can be omitted if serviceBusConnectionString is set at the topic level. |
namespace |
The Service Bus namespace (without .servicebus.windows.net suffix). Alternative to connectionString. Can inherit from topic-level settings. |
sharedAccessKeyName |
The shared access key name (e.g., RootManageSharedAccessKey). Used with namespace. |
sharedAccessKey |
The shared access key. Used with namespace. |
queue |
The queue name. Either queue or topic must be specified (not both). |
topic |
The topic name. Either queue or topic must be specified (not both). |
disabled |
(Optional) Set to true to disable this subscriber. Events will not be delivered to disabled subscribers. |
deliverySchema |
(Optional) Override the delivery schema. Values: EventGridSchema or CloudEventV1_0. |
filter |
(Optional) Event filtering configuration. See Filtering. |
properties |
(Optional) Custom delivery properties to add to Service Bus messages. See below. |
retryPolicy |
(Optional) Retry policy settings. See Retry and Dead-Letter. |
deadLetter |
(Optional) Dead-letter settings. See Retry and Dead-Letter. |
{
"subscribers": {
"serviceBus": [
{
"name": "OrdersQueue",
"connectionString": "Endpoint=sb://my-namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=...",
"queue": "orders-queue"
}
]
}
}You can set the connection string at the topic level and have subscribers inherit it:
{
"topics": [
{
"name": "OrdersTopic",
"port": 60101,
"serviceBusConnectionString": "Endpoint=sb://my-namespace.servicebus.windows.net/;...",
"subscribers": {
"serviceBus": [
{
"name": "OrdersQueue",
"queue": "orders-queue"
}
]
}
}
]
}Instead of a connection string, you can use namespace with shared access key:
{
"topics": [
{
"name": "OrdersTopic",
"port": 60101,
"serviceBusNamespace": "my-namespace",
"serviceBusSharedAccessKeyName": "RootManageSharedAccessKey",
"serviceBusSharedAccessKey": "...",
"subscribers": {
"serviceBus": [
{
"name": "OrdersQueue",
"queue": "orders-queue"
}
]
}
}
]
}You can add custom application properties to Service Bus messages using static or dynamic values:
{
"properties": {
"Region": {
"type": "static",
"value": "west-us"
},
"EventType": {
"type": "dynamic",
"value": "EventType"
},
"CustomerId": {
"type": "dynamic",
"value": "data.customerId"
}
}
}-
Static properties: The
valueis used as-is. -
Dynamic properties: The
valueis a path to extract from the event.
- Top-level fields:
Id,Subject,EventType,EventTime,DataVersion,Source,Topic - Data properties:
data.propertyNameordata.nested.property
You can filter which events are delivered to a subscriber. See Filtering for the complete filtering reference.
{
"subscribers": {
"serviceBus": [
{
"name": "HighPriorityOrders",
"queue": "high-priority-orders",
"filter": {
"includedEventTypes": ["Order.Created"],
"advancedFilters": [
{
"operatorType": "NumberGreaterThan",
"key": "data.amount",
"value": 1000
}
]
}
}
]
}
}{
"topics": [
{
"name": "OrdersTopic",
"port": 60101,
"key": "TheLocal+DevelopmentKey=",
"serviceBusConnectionString": "Endpoint=sb://my-namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=...",
"subscribers": {
"serviceBus": [
{
"name": "OrdersQueueSubscription",
"queue": "orders-queue",
"properties": {
"OrderId": { "type": "dynamic", "value": "data.orderId" },
"EventType": { "type": "dynamic", "value": "EventType" },
"Source": { "type": "static", "value": "EventGridSimulator" }
}
}
]
}
}
]
}- Configuration - Topic-level connection string settings
- Retry and Dead-Letter - Retry policies and dead-lettering
- Docker - Using with Azure Service Bus Emulator
Getting Started
Subscribers
Features
Deployment
Reference