Events

An event represents something that happens inside an Azure service (called the source) that communicates the event externally and that can be intercepted and managed by another Azure service (called the destination).

An event is composed of a set of information coded in a JSON format with a well-defined schema.

Azure Event Grid supports two different schemas for the events it can manage:

[
{
"topic": string,
"subject": string,
"id": string,
"eventType": string,
"eventTime": string,
"data":{
object-unique-to-each-publisher
},
"dataVersion": string,
"metadataVersion": string
}
]

Events have a common set of properties that identify each event and its source:

/subscriptions/{subscription-id}/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/{storageAccountName}
/blobServices/default/containers/oc2d2817345i200097container/blobs/oc2d2817345i20002296blob
    "data": {
"api": "PutBlockList",
"clientRequestId": "6d79dbfb-0e37-4fc4-981f-442c9ca65760",
"requestId": "831e1650-001e-001b-66ab-eeb76e000000",
"eTag": "0x8D4BCC2E4835CD0",
"contentType": "application/octet-stream",
"contentLength": 524288,
"blobType": "BlockBlob",
"url": "https://oc2d2817345i60006.blob.core.windows.net/oc2d2817345i200097container/oc2d2817345i20002296blob",
}
{
    "specversion" : "0.3",
    "type" : "Microsoft.Storage.BlobCreated",
    "source" : "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.Storage/storageAccounts/{storage-account}",
    "subject" : "/blobServices/default/containers/oc2d2817345i200097container/blobs/oc2d2817345i20002296blob",
    "id" : "173d9985-401e-0075-2497-de268c06ff25",
    "time" : "2018-04-05T17:31:00Z",
    "comexampleextension1" : "value",
    "comexampleextension2" : {
        "othervalue": 5
    },
    "datacontenttype" : "text/json",
    "data" : "{ 'api': 'PutBlockList',..., 'blobType': 'BlockBlob', 'url': 'https://oc2d2817345i60006.blob.core.windows.net/oc2d2817345i200097container/oc2d2817345i20002296blob' }"
}
You can find more information about the CloudEvents open specification at https://cloudevents.io/. The official GitHub repository for the specification is https://github.com/cloudevents/spec.

You can use both Azure events schemas (also known as Event Grid schemas) and CloudEvents for your input and output in Azure Event Grid.

Event sources always send events to Azure Event Grid as an array, even if there is only one event and the maximum size for the array is 1 MB. Each event in the array may have a size of up to 64 KB. If the size of the array is over the limits, you will receive an HTTP error 413 (payload too large) when you try to send the array.