You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Azure IoT Hub integrates with Azure Event Grid so that you can send event notifications to other services and trigger downstream processes. Configure your business applications to listen for IoT Hub events so that you can react to critical events in a reliable, scalable, and secure manner. For example, build an application that updates a database, creates a work ticket, and delivers an email notification every time a new IoT device is registered to your IoT hub.
18
18
19
-
[Azure Event Grid](../event-grid/overview.md) is a fully managed event routing service that uses a publish-subscribe model. Event Grid has built-in support for Azure services like [Azure Functions](../azure-functions/functions-overview.md) and [Azure Logic Apps](../logic-apps/logic-apps-overview.md), and can deliver event alerts to non-Azure services using webhooks. For a complete list of the event handlers that Event Grid supports, see [An introduction to Azure Event Grid](../event-grid/overview.md).
19
+
[Azure Event Grid](../event-grid/overview.md) is a fully managed event routing service that uses a publish-subscribe model. Event Grid has built-in support for Azure services like [Azure Functions](../azure-functions/functions-overview.md) and [Azure Logic Apps](../logic-apps/logic-apps-overview.md), and can deliver event alerts to non-Azure services using webhooks. For a complete list of the event handlers that Event Grid supports, see [What is Azure Event Grid?](../event-grid/overview.md).
20
20
21
21
To watch a video discussing this integration, see [Azure IoT Hub integration with Azure Event Grid](/shows/internet-of-things-show/iot-devices-and-event-grid).
22
22
@@ -38,11 +38,11 @@ IoT Hub publishes the following event types:
38
38
| Microsoft.Devices.DeviceDisconnected | Published when a device is disconnected from an IoT hub. |
39
39
| Microsoft.Devices.DeviceTelemetry | Published when a device telemetry message is sent to an IoT hub |
40
40
41
-
Use either the Azure portal or Azure CLI to configure which events to publish from each IoT hub. For an example, try the tutorial [Send email notifications about Azure IoT Hub events using Logic Apps](../event-grid/publish-iot-hub-events-to-logic-apps.md).
41
+
Use either the Azure portal or Azure CLI to configure which events to publish from each IoT hub. For an example, try the tutorial [Send email notifications about Azure IoT Hub events using Event Grid and Logic Apps](../event-grid/publish-iot-hub-events-to-logic-apps.md).
42
42
43
43
## Event schema
44
44
45
-
IoT Hub events contain all the information you need to respond to changes in your device lifecycle. You can identify an IoT Hub event by checking that the eventType property starts with **Microsoft.Devices**. For more information about how to use Event Grid event properties, see the [Event Grid event schema](../event-grid/event-schema.md).
45
+
IoT Hub events contain all the information you need to respond to changes in your device lifecycle. You can identify an IoT Hub event by checking that the eventType property starts with **Microsoft.Devices**. For more information about how to use Event Grid event properties, see [Azure Event Grid event schema](../event-grid/event-schema.md).
46
46
47
47
### Device connected schema
48
48
@@ -71,9 +71,9 @@ The following example shows the schema of a device connected event:
71
71
72
72
### Device telemetry schema
73
73
74
-
Device telemetry messages must be in a valid JSON format with the contentType set to **application/json** and contentEncoding set to **UTF-8** in the message [system properties](iot-hub-devguide-routing-query-syntax.md#system-properties). Both of these properties are case insensitive. If the content encoding is not set, then IoT Hub writes the messages in base 64 encoded format.
74
+
Device telemetry messages must be in a valid JSON format with the contentType set to **application/json** and contentEncoding set to **UTF-8** in the message [system properties](iot-hub-devguide-routing-query-syntax.md#system-properties). Both of these properties are case insensitive. If the content encoding isn't set, then IoT Hub writes the messages in base 64 encoded format.
75
75
76
-
You can enrich device telemetry events before they're published to Event Grid by selecting the endpoint as Event Grid. For more information, see [message enrichments](iot-hub-message-enrichments-overview.md).
76
+
You can enrich device telemetry events before they're published to Event Grid by selecting the endpoint as Event Grid. For more information, see [Message enrichments for device-to-cloud IoT Hub messages](iot-hub-message-enrichments-overview.md).
77
77
78
78
The following example shows the schema of a device telemetry event:
79
79
@@ -162,27 +162,27 @@ The following example shows the schema of a device created event:
162
162
> [!WARNING]
163
163
> *Twin data* associated with a device creation event is a default configuration and shouldn't be relied on for actual `authenticationType` and other device properties in a newly created device. For `authenticationType` and other device properties in a newly created device, use the register manager API provided in the Azure IoT SDKs.
164
164
165
-
For a detailed description of each property, see [Azure Event Grid event schema for IoT Hub](../event-grid/event-schema-iot-hub.md).
165
+
For a detailed description of each property, see [Azure IoT Hub as an Event Grid source](../event-grid/event-schema-iot-hub.md).
166
166
167
167
## Filter events
168
168
169
169
Event Grid enables [filtering](../event-grid/event-filtering.md) on event types, subjects, and data content. While creating the Event Grid subscription, you can choose to subscribe to selected IoT events.
170
170
171
-
* Event type: For the list of IoT Hub event types, see [event types](#event-types).
171
+
* Event type: For the list of IoT Hub event types, see [Event types](#event-types).
172
172
* Subject: For IoT Hub events, the subject is the device name. The subject takes the format `devices/{deviceId}`. You can filter subjects based on **Begins With** (prefix) and **Ends With** (suffix) matches. The filter uses an `AND` operator, so events with a subject that match both the prefix and suffix are delivered to the subscriber.
173
-
* Data content: The data content is populated by IoT Hub using the message format. You can choose what events are delivered based on the contents of the telemetry message. For examples, see [advanced filtering](../event-grid/event-filtering.md#advanced-filtering). For filtering on the telemetry message body, you must set the contentType to **application/json** and contentEncoding to **UTF-8** in the message [system properties](./iot-hub-devguide-routing-query-syntax.md#system-properties). Both of these properties are case insensitive.
173
+
* Data content: IoT Hub populates the data content using the message format. You can choose what events are delivered based on the contents of the telemetry message. For examples, see [Advanced filtering](../event-grid/event-filtering.md#advanced-filtering). For filtering on the telemetry message body, you must set the contentType to **application/json** and contentEncoding to **UTF-8** in the message [system properties](./iot-hub-devguide-routing-query-syntax.md#system-properties). Both of these properties are case insensitive.
174
174
175
-
For device telemetry events, IoT Hub will create the default [message route](iot-hub-devguide-messages-d2c.md) called *RouteToEventGrid* based on the subscription. To filter messages before telemetry data is sent, update the [routing query](iot-hub-devguide-routing-query-syntax.md).
175
+
For device telemetry events, IoT Hub creates the default [message route](iot-hub-devguide-messages-d2c.md) called *RouteToEventGrid* based on the subscription. To filter messages before telemetry data is sent, update the [routing query](iot-hub-devguide-routing-query-syntax.md).
176
176
177
177
## Limitations for device connection state events
178
178
179
-
Device connected and device disconnected events are available for devices connecting using either the MQTT or AMQP protocol, or using either of these protocols over WebSockets. Requests made only with HTTPS won't trigger device connection state notifications.
179
+
Device connected and device disconnected events are available for devices connecting using either the MQTT or AMQP protocol, or using either of these protocols over WebSockets. Requests made only with HTTPS don't trigger device connection state notifications.
180
180
181
-
For information about monitoring device status with Event Grid, see [Monitor device connection status](./monitor-device-connection-state.md#event-grid).
181
+
For more information about monitoring device status with Event Grid, see [Monitor device connection status](./monitor-device-connection-state.md#event-grid).
182
182
183
183
### Device connection state interval
184
184
185
-
IoT Hub attempts to report each device connection state change event, but some may be missed. At minimum, IoT Hub reports connection state change events that occur 60 seconds apart from each other. This behavior may lead to outcomes such as multiple device connect events reported with no device disconnect events between them.
185
+
IoT Hub attempts to report each device connection state change event, but some might be missed. At minimum, IoT Hub reports connection state change events that occur 60 seconds apart from each other. This behavior might lead to outcomes such as multiple device connect events reported with no device disconnect events between them.
186
186
187
187
<!--
188
188

@@ -198,6 +198,6 @@ Applications that handle IoT Hub events should follow these suggested practices:
198
198
199
199
## Next steps
200
200
201
-
*[Learn how to order device connected and disconnected events](iot-hub-how-to-order-connection-state-events.md)
202
-
*[Compare the differences between routing IoT Hub events and messages](iot-hub-event-grid-routing-comparison.md)
203
-
*[Learn more about how to use Event Grid and Azure Monitor to monitor, diagnose, and troubleshoot device connectivity to IoT Hub](iot-hub-troubleshoot-connectivity.md)
201
+
*[Order device connection events from Azure IoT Hub using Azure Cosmos DB](iot-hub-how-to-order-connection-state-events.md)
202
+
*[Compare message routing and Event Grid for IoT Hub](iot-hub-event-grid-routing-comparison.md)
203
+
*[Monitor, diagnose, and troubleshoot Azure IoT Hub device connectivity](iot-hub-troubleshoot-connectivity.md)
0 commit comments