Azure Event Hubs as an Event Grid source

This article provides the properties and schema for event hubs events. For an introduction to event schemas, see Azure Event Grid event schema.

Available event types

Event Hubs emits the Microsoft.EventHub.CaptureFileCreated event type when a capture file is created.

Example event

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"
    }
]

Event properties

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.

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.

Tutorials and how-tos

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.

Next steps