Skip to content

Commit 7299ce6

Browse files
authored
Merge pull request #110870 from spelluru/egridtoc0409
System topics & Event sources
2 parents 5788010 + ff04bdc commit 7299ce6

26 files changed

+1111
-380
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4952,6 +4952,11 @@
49524952
"redirect_url": "/azure/azure-resource-manager/management/view-activity-logs",
49534953
"redirect_document_id": false
49544954
},
4955+
{
4956+
"source_path": "articles/event-grid/event-sources.md",
4957+
"redirect_url": "/azure/event-grid/overview#event-sources",
4958+
"redirect_document_id": false
4959+
},
49554960
{
49564961
"source_path": "articles/event-grid/event-subscription-template.md",
49574962
"redirect_url": "/azure/event-grid/template-samples",
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: Use Azure Event Grid with events in CloudEvents schema
3+
description: Describes how to use the CloudEvents schema for events in Azure Event Grid. The service supports events in the JSON implementation of Cloud Events.
4+
services: event-grid
5+
author: banisadr
6+
7+
ms.service: event-grid
8+
ms.topic: conceptual
9+
ms.date: 01/21/2020
10+
ms.author: babanisa
11+
---
12+
13+
# CloudEvents v1.0 schema with Event Grid
14+
15+
In addition to its [default event schema](event-schema.md), Azure Event Grid natively supports events in the [JSON implementation of CloudEvents v1.0](https://github.com/cloudevents/spec/blob/v1.0/json-format.md) and [HTTP protocol binding](https://github.com/cloudevents/spec/blob/v1.0/http-protocol-binding.md). [CloudEvents](https://cloudevents.io/) is an [open specification](https://github.com/cloudevents/spec/blob/v1.0/spec.md) for describing event data.
16+
17+
CloudEvents simplifies interoperability by providing a common event schema for publishing, and consuming cloud based events. This schema allows for uniform tooling, standard ways of routing & handling events, and universal ways of deserializing the outer event schema. With a common schema, you can more easily integrate work across platforms.
18+
19+
CloudEvents is being built by several [collaborators](https://github.com/cloudevents/spec/blob/master/community/contributors.md), including Microsoft, through the [Cloud Native Computing Foundation](https://www.cncf.io/). It's currently available as version 1.0.
20+
21+
This article describes CloudEvents schema with Event Grid.
22+
23+
## Sample event using CloudEvents schema
24+
25+
Here is an example of an Azure Blob Storage event in CloudEvents format:
26+
27+
``` JSON
28+
{
29+
"specversion": "1.0",
30+
"type": "Microsoft.Storage.BlobCreated",
31+
"source": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.Storage/storageAccounts/{storage-account}",
32+
"id": "9aeb0fdf-c01e-0131-0922-9eb54906e209",
33+
"time": "2019-11-18T15:13:39.4589254Z",
34+
"subject": "blobServices/default/containers/{storage-container}/blobs/{new-file}",
35+
"dataschema": "#",
36+
"data": {
37+
"api": "PutBlockList",
38+
"clientRequestId": "4c5dd7fb-2c48-4a27-bb30-5361b5de920a",
39+
"requestId": "9aeb0fdf-c01e-0131-0922-9eb549000000",
40+
"eTag": "0x8D76C39E4407333",
41+
"contentType": "image/png",
42+
"contentLength": 30699,
43+
"blobType": "BlockBlob",
44+
"url": "https://gridtesting.blob.core.windows.net/testcontainer/{new-file}",
45+
"sequencer": "000000000000000000000000000099240000000000c41c18",
46+
"storageDiagnostics": {
47+
"batchId": "681fe319-3006-00a8-0022-9e7cde000000"
48+
}
49+
}
50+
}
51+
```
52+
53+
A detailed description of the available fields, their types, and definitions in CloudEvents v1.0 is [available here](https://github.com/cloudevents/spec/blob/v1.0/spec.md#required-attributes).
54+
55+
The headers values for events delivered in the CloudEvents schema and the Event Grid schema are the same except for `content-type`. For CloudEvents schema, that header value is `"content-type":"application/cloudevents+json; charset=utf-8"`. For Event Grid schema, that header value is `"content-type":"application/json; charset=utf-8"`.
56+
57+
## Event Grid for CloudEvents
58+
59+
You can use Event Grid for both input and output of events in CloudEvents schema. You can use CloudEvents for system events, like Blob Storage events and IoT Hub events, and custom events. It can also transform those events on the wire back and forth.
60+
61+
62+
| Input schema | Output schema
63+
|--------------------|---------------------
64+
| CloudEvents format | CloudEvents format
65+
| Event Grid format | CloudEvents format
66+
| Event Grid format | Event Grid format
67+
68+
For all event schemas, Event Grid requires validation when publishing to an event grid topic and when creating an event subscription. For more information, see [Event Grid security and authentication](security-authentication.md).
69+
70+
## Next steps
71+
See [How to use CloudEvents v1.0 schema with Event Grid](cloudevents-schema.md).

articles/event-grid/cloudevents-schema.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ ms.author: babanisa
1111
---
1212

1313
# Use CloudEvents v1.0 schema with Event Grid
14-
1514
In addition to its [default event schema](event-schema.md), Azure Event Grid natively supports events in the [JSON implementation of CloudEvents v1.0](https://github.com/cloudevents/spec/blob/v1.0/json-format.md) and [HTTP protocol binding](https://github.com/cloudevents/spec/blob/v1.0/http-protocol-binding.md). [CloudEvents](https://cloudevents.io/) is an [open specification](https://github.com/cloudevents/spec/blob/v1.0/spec.md) for describing event data.
1615

1716
CloudEvents simplifies interoperability by providing a common event schema for publishing, and consuming cloud based events. This schema allows for uniform tooling, standard ways of routing & handling events, and universal ways of deserializing the outer event schema. With a common schema, you can more easily integrate work across platforms.

articles/event-grid/concepts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ A publisher is the user or organization that decides to send events to Event Gri
3131

3232
An event source is where the event happens. Each event source is related to one or more event types. For example, Azure Storage is the event source for blob created events. IoT Hub is the event source for device created events. Your application is the event source for custom events that you define. Event sources are responsible for sending events to Event Grid.
3333

34-
For information about implementing any of the supported Event Grid sources, see [Event sources in Azure Event Grid](event-sources.md).
34+
For information about implementing any of the supported Event Grid sources, see [Event sources in Azure Event Grid](overview.md#event-sources).
3535

3636
## Topics
3737

articles/event-grid/custom-topics.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: Custom topics in Azure Event Grid
3+
description: Describes custom topics in Azure Event Grid.
4+
services: event-grid
5+
author: spelluru
6+
7+
ms.service: event-grid
8+
ms.topic: conceptual
9+
ms.date: 03/16/2020
10+
ms.author: spelluru
11+
---
12+
13+
# Custom topics in Azure Event Grid
14+
An event grid topic provides an endpoint where the source sends events. The publisher creates the event grid topic, and decides whether an event source needs one topic or more than one topic. A topic is used for a collection of related events. To respond to certain types of events, subscribers decide which topics to subscribe to.
15+
16+
**Custom topics** are application and third-party topics. When you create or are assigned access to a custom topic, you see that custom topic in your subscription.
17+
18+
When designing your application, you have flexibility when deciding how many topics to create. For large solutions, create a **custom topic** for **each category of related events**. For example, consider an application that sends events related to modifying user accounts and processing orders. It's unlikely any event handler wants both categories of events. Create two custom topics and let event handlers subscribe to the one that interests them. For small solutions, you might prefer to send all events to a single topic. Event subscribers can filter for the event types they want.
19+
20+
## Event schema
21+
For a detailed overview of event schema, see [Azure Event Grid event schema](event-schema.md). For custom topics, the event publisher determines the **data** object. The top-level data should have the same fields as standard resource-defined events.
22+
23+
```json
24+
[
25+
{
26+
"topic": string,
27+
"subject": string,
28+
"id": string,
29+
"eventType": string,
30+
"eventTime": string,
31+
"data":{
32+
object-unique-to-each-publisher
33+
},
34+
"dataVersion": string,
35+
"metadataVersion": string
36+
}
37+
]
38+
```
39+
40+
The following sections provide links to tutorials to create custom topics using Azure portal, CLI, PowerShell, and Azure Resource Manager (ARM) templates.
41+
42+
43+
## Azure portal tutorials
44+
|Title |Description |
45+
|---------|---------|
46+
| [Quickstart: create and route custom events with the Azure portal](custom-event-quickstart-portal.md) | Shows how to use the portal to send custom events. |
47+
| [Quickstart: route custom events to Azure Queue storage](custom-event-to-queue-storage.md) | Describes how to send custom events to a Queue storage. |
48+
| [How to: post to custom topic](post-to-custom-topic.md) | Shows how to post an event to a custom topic. |
49+
50+
51+
## Azure CLI tutorials
52+
|Title |Description |
53+
|---------|---------|
54+
| [Quickstart: create and route custom events with Azure CLI](custom-event-quickstart.md) | Shows how to use Azure CLI to send custom events. |
55+
| [Azure CLI: create Event Grid custom topic](./scripts/event-grid-cli-create-custom-topic.md)|Sample script that creates a custom topic. The script retrieves the endpoint and a key.|
56+
| [Azure CLI: subscribe to events for a custom topic](./scripts/event-grid-cli-subscribe-custom-topic.md)|Sample script that creates a subscription for a custom topic. It sends events to a WebHook.|
57+
58+
## Azure PowerShell tutorials
59+
|Title |Description |
60+
|---------|---------|
61+
| [Quickstart: create and route custom events with Azure PowerShell](custom-event-quickstart-powershell.md) | Shows how to use Azure PowerShell to send custom events. |
62+
| [PowerShell: create Event Grid custom topic](./scripts/event-grid-powershell-create-custom-topic.md)|Sample script that creates a custom topic. The script retrieves the endpoint and a key.|
63+
| [PowerShell: subscribe to events for a custom topic](./scripts/event-grid-powershell-subscribe-custom-topic.md)|Sample script that creates a subscription for a custom topic. It sends events to a WebHook.|
64+
65+
## ARM template tutorials
66+
|Title |Description |
67+
|---------|---------|
68+
| [Resource Manager template: custom topic and WebHook endpoint](https://github.com/Azure/azure-quickstart-templates/tree/master/101-event-grid) | A Resource Manager template that creates a custom topic and subscription for that custom topic. It sends events to a WebHook. |
69+
| [Resource Manager template: custom topic and Event Hubs endpoint](https://github.com/Azure/azure-quickstart-templates/tree/master/101-event-grid-event-hubs-handler)| A Resource Manager template that creates a subscription for a custom topic. It sends events to an Azure Event Hubs. |
70+
71+
## Next steps
72+
See the following articles:
73+
74+
- [System topics](system-topics.md)
75+
- [Domains](event-domains.md)

articles/event-grid/event-handlers.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ Event Hubs can act as either an event source or event handler. The following art
4949
| [Quickstart: route custom events to Azure Event Hubs with Azure CLI and Event Grid](custom-event-to-eventhub.md) | Sends a custom event to an event hub for processing by an application. |
5050
| [Resource Manager template: custom topic and Event Hubs endpoint](https://github.com/Azure/azure-quickstart-templates/tree/master/101-event-grid-event-hubs-handler)| A Resource Manager template that creates a subscription for a custom topic. It sends events to an Azure Event Hubs. |
5151

52-
For examples of Event Hubs as a source, see [Event Hubs source](event-sources.md#event-hubs).
53-
5452
## Hybrid Connections
5553

5654
Use Azure Relay Hybrid Connections to send events to applications that are within an enterprise network and don't have a publicly accessible endpoint.

articles/event-grid/event-schema-app-configuration.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
---
2-
title: Azure Event Grid Azure App Configuration event schema
3-
description: Describes the properties that are provided for Azure App Configuration events with Azure Event Grid
2+
title: Azure App Configuration as Event Grid source
3+
description: This article describes how to use Azure App Configuration as an Event Grid event source. It provides the schema and links to tutorial and how-to articles.
44
services: event-grid
5-
author: jimmyca
5+
author: banisadr
66

77
ms.service: event-grid
8-
ms.topic: reference
9-
ms.date: 05/30/2019
10-
ms.author: jimmyca
8+
ms.topic: conceptual
9+
ms.date: 04/09/2020
10+
ms.author: babanisa
1111
---
1212

13-
# Azure Event Grid event schema for Azure App Configuration
13+
# Azure App Configuration as an Event Grid source
14+
This article provides the properties and schema for Azure App Configuration events. For an introduction to event schemas, see [Azure Event Grid event schema](event-schema.md). It also gives you a list of quick starts and tutorials to use Azure App Configuration as an event source.
1415

15-
This article provides the properties and schema for Azure App Configuration events. For an introduction to event schemas, see [Azure Event Grid event schema](event-schema.md).
16+
## Event Grid event schema
1617

17-
For a list of sample scripts and tutorials, see [Azure App Configuration event source](event-sources.md#app-configuration).
18-
19-
## Available event types
18+
### Available event types
2019

2120
Azure App Configuration emits the following event types:
2221

@@ -25,7 +24,7 @@ Azure App Configuration emits the following event types:
2524
| Microsoft.AppConfiguration.KeyValueModified | Raised when a key-value is created or replaced. |
2625
| Microsoft.AppConfiguration.KeyValueDeleted | Raised when a key-value is deleted. |
2726

28-
## Example event
27+
### Example event
2928

3029
The following example shows the schema of a key-value modified event:
3130

@@ -65,7 +64,7 @@ The schema for a key-value deleted event is similar:
6564
}]
6665
```
6766

68-
## Event properties
67+
### Event properties
6968

7069
An event has the following top-level data:
7170

@@ -75,7 +74,7 @@ An event has the following top-level data:
7574
| subject | string | Publisher-defined path to the event subject. |
7675
| eventType | string | One of the registered event types for this event source. |
7776
| eventTime | string | The time the event is generated based on the provider's UTC time. |
78-
| id | string | Unique identifier for the event. |
77+
| ID | string | Unique identifier for the event. |
7978
| data | object | App Configuration event data. |
8079
| dataVersion | string | The schema version of the data object. The publisher defines the schema version. |
8180
| metadataVersion | string | The schema version of the event metadata. Event Grid defines the schema of the top-level properties. Event Grid provides this value. |
@@ -87,7 +86,14 @@ The data object has the following properties:
8786
| key | string | The key of the key-value that was modified or deleted. |
8887
| label | string | The label, if any, of the key-value that was modified or deleted. |
8988
| etag | string | For `KeyValueModified` the etag of the new key-value. For `KeyValueDeleted` the etag of the key-value that was deleted. |
90-
89+
90+
## Tutorials and how-tos
91+
92+
|Title | Description |
93+
|---------|---------|
94+
| [React to Azure App Configuration events by using Event Grid](../azure-app-configuration/concept-app-configuration-event.md?toc=%2fazure%2fevent-grid%2ftoc.json) | Overview of integrating Azure App Configuration with Event Grid. |
95+
| [Quickstart: route Azure App Configuration events to a custom web endpoint with Azure CLI](../azure-app-configuration/howto-app-configuration-event.md?toc=%2fazure%2fevent-grid%2ftoc.json) | Shows how to use Azure CLI to send Azure App Configuration events to a WebHook. |
96+
9197
## Next steps
9298

9399
* For an introduction to Azure Event Grid, see [What is Event Grid?](overview.md)

articles/event-grid/event-schema-azure-maps.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
---
2-
title: Azure Event Grid Azure Maps event schema
2+
title: Azure Maps as Event Grid source
33
description: Describes the properties and schema provided for Azure Maps events with Azure Event Grid
44
services: event-grid
5-
author: femila
5+
author: banisadr
66
ms.service: event-grid
7-
ms.topic: reference
8-
ms.date: 02/08/2019
9-
ms.author: femila
7+
ms.topic: conceptual
8+
ms.date: 04/09/2020
9+
ms.author: babanisa
1010
---
1111

12-
# Azure Event Grid event schema for Azure Maps
12+
# Azure Maps as an Event Grid source
1313

14-
This article provides the properties and schema for Azure Maps events. For an introduction to event schemas, see [Azure Event Grid event schema](https://docs.microsoft.com/azure/event-grid/event-schema).
14+
This article provides the properties and schema for Azure Maps events. For an introduction to event schemas, see [Azure Event Grid event schema](https://docs.microsoft.com/azure/event-grid/event-schema). It also gives you a list of quick starts and tutorials to use Azure Maps as an event source.
1515

16-
## Available event types
16+
## Event Grid event schema
17+
18+
### Available event types
1719

1820
An Azure Maps account emits the following event types:
1921

@@ -23,7 +25,7 @@ An Azure Maps account emits the following event types:
2325
| Microsoft.Maps.GeofenceExited | Raised when coordinates received have moved from within a given geofence to outside |
2426
| Microsoft.Maps.GeofenceResult | Raised every time a geofencing query returns a result, regardless of the state |
2527

26-
## Event examples
28+
### Event examples
2729

2830
The following example shows the schema of a **GeofenceEntered** event
2931

@@ -93,7 +95,7 @@ The following example show schema for **GeofenceResult**
9395
}
9496
```
9597

96-
## Event properties
98+
### Event properties
9799

98100
An event has the following top-level data:
99101

@@ -158,6 +160,12 @@ The data object has the following properties:
158160
| invalidPeriodGeofenceGeometryId | string[] | Lists of the geometry ID of the geofence that is in invalid period relative to the user time in the request. |
159161
| isEventPublished | boolean | True if at least one event is published to the Azure Maps event subscriber, false if no event is published to the Azure Maps event subscriber. |
160162

163+
## Tutorials and how-tos
164+
|Title |Description |
165+
|---------|---------|
166+
| [React to Azure Maps events by using Event Grid](../azure-maps/azure-maps-event-grid-integration.md?toc=%2fazure%2fevent-grid%2ftoc.json) | Overview of integrating Azure Maps with Event Grid. |
167+
| [Tutorial: Set up a geofence](../azure-maps/tutorial-geofence.md?toc=%2fazure%2fevent-grid%2ftoc.json) | This tutorial walks you through the basics steps to set up geofence by using Azure Maps. You use Azure Event Grid to stream the geofence results and set up a notification based on the geofence results. |
168+
161169
## Next steps
162170

163171
* For an introduction to Azure Event Grid, see [What is Event Grid?](overview.md)

0 commit comments

Comments
 (0)