| title | Azure Event Hubs as Event Grid source |
|---|---|
| description | Describes the properties that are provided for event hubs events with Azure Event Grid |
| ms.topic | concept-article |
| ms.date | 12/02/2022 |
This article provides the properties and schema for event hubs events. For an introduction to event schemas, see Azure Event Grid event schema.
Event Hubs emits the Microsoft.EventHub.CaptureFileCreated event type when a capture file is created.
This sample event shows the schema of an event hubs event raised when the capture feature stores a file:
[
{
"source": "/subscriptions/<guid>/resourcegroups/rgDataMigrationSample/providers/Microsoft.EventHub/namespaces/tfdatamigratens",
"subject": "eventhubs/hubdatamigration",
"type": "Microsoft.EventHub.CaptureFileCreated",
"time": "2017-08-31T19:12:46.0498024Z",
"id": "14e87d03-6fbf-4bb2-9a21-92bd1281f247",
"data": {
"fileUrl": "https://tf0831datamigrate.blob.core.windows.net/windturbinecapture/tfdatamigratens/hubdatamigration/1/2017/08/31/19/11/45.avro",
"fileType": "AzureBlockBlob",
"partitionId": "1",
"sizeInBytes": 249168,
"eventCount": 1500,
"firstSequenceNumber": 2400,
"lastSequenceNumber": 3899,
"firstEnqueueTime": "2017-08-31T19:12:14.674Z",
"lastEnqueueTime": "2017-08-31T19:12:44.309Z"
},
"specversion": "1.0"
}
]This sample event shows the schema of an event hubs event raised when the capture feature stores a file:
[
{
"topic": "/subscriptions/<guid>/resourcegroups/rgDataMigrationSample/providers/Microsoft.EventHub/namespaces/tfdatamigratens",
"subject": "eventhubs/hubdatamigration",
"eventType": "Microsoft.EventHub.CaptureFileCreated",
"eventTime": "2017-08-31T19:12:46.0498024Z",
"id": "14e87d03-6fbf-4bb2-9a21-92bd1281f247",
"data": {
"fileUrl": "https://tf0831datamigrate.blob.core.windows.net/windturbinecapture/tfdatamigratens/hubdatamigration/1/2017/08/31/19/11/45.avro",
"fileType": "AzureBlockBlob",
"partitionId": "1",
"sizeInBytes": 249168,
"eventCount": 1500,
"firstSequenceNumber": 2400,
"lastSequenceNumber": 3899,
"firstEnqueueTime": "2017-08-31T19:12:14.674Z",
"lastEnqueueTime": "2017-08-31T19:12:44.309Z"
},
"dataVersion": "",
"metadataVersion": "1"
}
]An event has the following top-level data:
| Property | Type | Description |
|---|---|---|
source |
string | Full resource path to the event source. This field is not writeable. Event Grid provides this value. |
subject |
string | Publisher-defined path to the event subject. |
type |
string | One of the registered event types for this event source. |
time |
string | The time the event is generated based on the provider's UTC time. |
id |
string | Unique identifier for the event. |
data |
object | Event hub event data. |
specversion |
string | CloudEvents schema specification version. |
An event has the following top-level data:
| Property | Type | Description |
|---|---|---|
topic |
string | Full resource path to the event source. This field is not writeable. Event Grid provides this value. |
subject |
string | Publisher-defined path to the event subject. |
eventType |
string | One of the registered event types for this event source. |
eventTime |
string | The time the event is generated based on the provider's UTC time. |
id |
string | Unique identifier for the event. |
data |
object | Event hub event data. |
dataVersion |
string | The schema version of the data object. The publisher defines the schema version. |
metadataVersion |
string | The schema version of the event metadata. Event Grid defines the schema of the top-level properties. Event Grid provides this value. |
The data object has the following properties:
| Property | Type | Description |
|---|---|---|
fileUrl |
string | The path to the capture file. |
fileType |
string | The file type of the capture file. |
partitionId |
string | The shard ID. |
sizeInBytes |
integer | The file size. |
eventCount |
integer | The number of events in the file. |
firstSequenceNumber |
integer | The smallest sequence number from the queue. |
lastSequenceNumber |
integer | The last sequence number from the queue. |
firstEnqueueTime |
string | The first time from the queue. |
lastEnqueueTime |
string | The last time from the queue. |
| Title | Description |
|---|---|
| Tutorial: stream big data into a data warehouse | When Event Hubs creates a Capture file, Event Grid sends an event to a function app. The app retrieves the Capture file and migrates data to a data warehouse. |
- For an introduction to Azure Event Grid, see What is Event Grid?
- For more information about creating an Azure Event Grid subscription, see Event Grid subscription schema.
- For information about handling event hubs events, see Stream big data into a data warehouse.