-
-
Notifications
You must be signed in to change notification settings - Fork 41
Event Hub Subscribers
Paul Mcilreavy edited this page Dec 22, 2025
·
2 revisions
Event Hub subscribers deliver events to Azure Event Hubs.
| Setting | Description |
|---|---|
name |
The name of the subscriber. |
connectionString |
The Event Hub connection string. Can be omitted if eventHubConnectionString is set at the topic level. |
namespace |
The Event Hub 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. |
eventHubName |
The name of the Event Hub to send events to. (Required) |
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 Event Hub messages. See below. |
retryPolicy |
(Optional) Retry policy settings. See Retry and Dead-Letter. |
deadLetter |
(Optional) Dead-letter settings. See Retry and Dead-Letter. |
{
"subscribers": {
"eventHub": [
{
"name": "OrdersEventHub",
"connectionString": "Endpoint=sb://my-namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=...",
"eventHubName": "orders-events"
}
]
}
}You can set the connection string at the topic level and have subscribers inherit it:
{
"topics": [
{
"name": "OrdersTopic",
"port": 60101,
"eventHubConnectionString": "Endpoint=sb://my-namespace.servicebus.windows.net/;...",
"subscribers": {
"eventHub": [
{
"name": "OrdersEventHub",
"eventHubName": "orders-events"
}
]
}
}
]
}Instead of a connection string, you can use namespace with shared access key:
{
"topics": [
{
"name": "OrdersTopic",
"port": 60101,
"eventHubNamespace": "my-eventhub-namespace",
"eventHubSharedAccessKeyName": "RootManageSharedAccessKey",
"eventHubSharedAccessKey": "...",
"subscribers": {
"eventHub": [
{
"name": "OrdersEventHub",
"eventHubName": "orders-events"
}
]
}
}
]
}Event Hub messages include standard Event Grid headers as properties:
| Header | Description |
|---|---|
aeg-event-type |
Always "Notification" |
aeg-subscription-name |
The subscriber name (uppercase) |
aeg-delivery-count |
The delivery attempt number |
aeg-output-event-id |
The event ID |
aeg-data-version |
The event data version (EventGrid schema only) |
aeg-metadata-version |
Always "1" (EventGrid schema only) |
You can add custom application properties to Event Hub messages using static or dynamic values:
{
"properties": {
"Region": {
"type": "static",
"value": "west-us"
},
"OrderId": {
"type": "dynamic",
"value": "data.orderId"
}
}
}-
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
{
"topics": [
{
"name": "OrdersTopic",
"port": 60101,
"key": "TheLocal+DevelopmentKey=",
"eventHubConnectionString": "Endpoint=sb://my-eventhub-namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=...",
"subscribers": {
"eventHub": [
{
"name": "OrdersEventHubSubscription",
"eventHubName": "orders-events",
"deliverySchema": "CloudEventV1_0",
"filter": {
"includedEventTypes": ["Order.Created"]
},
"properties": {
"OrderId": { "type": "dynamic", "value": "data.orderId" },
"Region": { "type": "static", "value": "west-us" }
}
}
]
}
}
]
}- Configuration - Topic-level connection string settings
- Filtering - Event filtering options
- Retry and Dead-Letter - Retry policies and dead-lettering
- Docker - Using with Azure Event Hubs Emulator
Getting Started
Subscribers
Features
Deployment
Reference