Skip to content

Commit ec099af

Browse files
Merge pull request #295469 from kgremban/feb27-hubfresh
IoT Hub freshness
2 parents 73f94f9 + e58ded8 commit ec099af

File tree

3 files changed

+31
-43
lines changed

3 files changed

+31
-43
lines changed

articles/iot-hub/iot-concepts-and-iot-hub.md

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ ms.author: kgremban
77
ms.service: azure-iot-hub
88
services: iot-hub
99
ms.topic: overview
10-
ms.date: 02/22/2024
10+
ms.date: 02/27/2025
1111
#Customer intent: As a developer new to IoT Hub, learn the basic concepts.
1212
---
1313

1414
# What is Azure IoT Hub?
1515

16-
The Internet of Things (IoT) is a network of physical devices that connect to and exchange data with other devices and services over the Internet or other network. There are currently over ten billion connected devices in the world and more are added every year. Anything that can be embedded with the necessary sensors and software can be connected over the internet.
16+
The Internet of Things (IoT) is a network of physical devices that connect to and exchange data with other devices and services over the Internet or other network. There are currently over 10 billion connected devices in the world and more are added every year. Anything that can be embedded with the necessary sensors and software can be connected over the internet.
1717

1818
Azure IoT Hub is a managed service hosted in the cloud that acts as a central message hub for communication between an IoT application and its attached devices. You can connect millions of devices and their backend solutions reliably and securely. Almost any device can be connected to an IoT hub.
1919

@@ -23,24 +23,21 @@ IoT Hub scales to millions of simultaneously connected devices and millions of e
2323

2424
You can integrate IoT Hub with other Azure services to build complete, end-to-end solutions. For example, use:
2525

26-
- [Azure Event Grid](../event-grid/index.yml) to enable your business to react quickly to critical events in a reliable, scalable, and secure manner.
27-
26+
- [Azure Event Grid](../event-grid/index.yml) to enable your business to react quickly to critical events.
2827
- [Azure Logic Apps](../logic-apps/index.yml) to automate business processes.
29-
3028
- [Azure Machine Learning](/azure/machine-learning/) to add machine learning and AI models to your solution.
31-
3229
- [Azure Stream Analytics](../stream-analytics/index.yml) to run real-time analytic computations on the data streaming from your devices.
3330

3431
## IoT devices
3532

3633
IoT devices differ from other clients such as browsers and mobile apps. Specifically, IoT devices:
3734

38-
- Are often embedded systems with no human operator.
39-
- Can be deployed in remote locations where physical access is expensive.
40-
- Might only be reachable through the solution back end.
41-
- Might have limited power and processing resources.
42-
- Might have intermittent, slow, or expensive network connectivity.
43-
- Might need to use proprietary, custom, or industry-specific application protocols.
35+
- Are often embedded systems with no human operator
36+
- Can be deployed in remote locations where physical access is expensive
37+
- Might only be reachable through the solution back end
38+
- Might have limited power and processing resources
39+
- Might have intermittent, slow, or expensive network connectivity
40+
- Might need to use proprietary, custom, or industry-specific application protocols
4441

4542
## Device identity and authentication
4643

@@ -62,7 +59,7 @@ Typically, IoT devices send data from the sensors to back-end services in the cl
6259

6360
- A refrigeration truck sending temperature every 5 minutes to an IoT hub.
6461
- A back-end service sending a command to a device to change the frequency at which it sends data to help diagnose a problem.
65-
- A device monitoring a batch reactor in a chemical plant, sending an alert when the temperature exceeds a certain value.
62+
- A device monitoring a batch reactor in a chemical plant sending an alert when the temperature exceeds a certain value.
6663

6764
For more information, see [Device infrastructure and connectivity](../iot/iot-overview-device-connectivity.md).
6865

@@ -78,7 +75,7 @@ You can enable properties in IoT Hub using [Device twins](iot-hub-devguide-devic
7875

7976
## Device commands
8077

81-
An example of a command is rebooting a device. IoT Hub implements commands by allowing you to invoke direct methods on devices. [Direct methods](iot-hub-devguide-direct-methods.md) represent a request-reply interaction with a device similar to an HTTP call in that they succeed or fail immediately (after a user-specified timeout). This approach is useful for scenarios where the course of immediate action is different depending on whether the device was able to respond.
78+
IoT Hub implements commands by allowing you to invoke direct methods on devices. An example of a command is rebooting a device. [Direct methods](iot-hub-devguide-direct-methods.md) represent a request-reply interaction with a device similar to an HTTP call in that they succeed or fail immediately (after a user-specified time-out). This approach is useful for scenarios where the course of immediate action is different depending on whether the device was able to respond.
8279

8380
## Act on device data
8481

@@ -103,21 +100,17 @@ For more information about IoT Hub endpoints, see [IoT Hub endpoints](iot-hub-de
103100

104101
Data can also be routed to different services for further processing. As the IoT solution scales out, the number of devices, volume of events, variety of events, and different services also varies. A flexible, scalable, consistent, and reliable method to route events is necessary to serve this pattern. For a tutorial showing multiple uses of message routing, see [Tutorial: Send device data to Azure Storage using IoT Hub message routing](tutorial-routing.md).
105102

106-
IoT Hub supports setting up custom endpoints for Azure services including Storage containers, Event Hubs, Service Bus queues, Service Bus topics, and Cosmos DB. Once the endpoint has been set up, you can route your IoT data to any of these endpoints to perform downstream data operations.
107-
108-
IoT Hub also integrates with Event Grid, which enables you to fan out data to multiple subscribers. Event Grid is a fully managed event service that enables you to easily manage events across many different Azure services and applications. Event Grid simplifies building event-driven applications and serverless architectures.
103+
IoT Hub supports setting up custom endpoints for Azure services including Storage containers, Event Hubs, Service Bus queues, Service Bus topics, and Cosmos DB. Once the endpoint is set up, you can route your IoT data to any of these endpoints to perform downstream data operations.
109104

110-
For more information, see [Compare message routing and Event Grid for IoT Hub](iot-hub-event-grid-routing-comparison.md).
105+
IoT Hub also integrates with Event Grid, which enables you to fan out data to multiple subscribers. Event Grid is a fully managed event service that enables you to easily manage events across many different Azure services and applications. Event Grid simplifies building event-driven applications and serverless architectures. For more information, see [Compare message routing and Event Grid for IoT Hub](iot-hub-event-grid-routing-comparison.md).
111106

112107
## Next steps
113108

114109
To try out an end-to-end IoT solution, check out the IoT Hub quickstarts:
115110

116111
- [Send telemetry from a device to IoT Hub](quickstart-send-telemetry-cli.md)
117-
- [Send telemetry from an IoT Plug and Play device to IoT Hub](../iot/tutorial-send-telemetry-iot-hub.md?toc=/azure/iot-hub/toc.json&bc=/azure/iot-hub/breadcrumb/toc.json)
118-
- [Quickstart: Control a device connected to an IoT hub](quickstart-control-device.md)
112+
- [Control a device connected to an IoT hub](quickstart-control-device.md)
119113

120114
To learn more about the ways you can build and deploy IoT solutions with Azure IoT, visit:
121115

122116
- [What is Azure Internet of Things?](../iot/iot-introduction.md)
123-
- [What is Azure IoT device and application development?](../iot/concepts-iot-device-development.md)

articles/iot-hub/iot-hub-devguide-messages-d2c.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: Understand Azure IoT Hub message routing
33
titleSuffix: Azure IoT Hub
4-
description: This article describes how to use message routing to send device-to-cloud messages. Includes information about sending both telemetry and non-telemetry data.
4+
description: This article describes how to use message routing to send device-to-cloud messages. Includes information about sending both telemetry and nontelemetry data.
55
author: kgremban
66

77
ms.author: kgremban
88
ms.service: azure-iot-hub
99
ms.topic: concept-article
10-
ms.date: 02/23/2024
10+
ms.date: 02/27/2025
1111
ms.custom: ['Role: Cloud Development', devx-track-csharp]
1212
---
1313

@@ -42,14 +42,9 @@ Each message is routed to all endpoints whose routing queries it matches, which
4242

4343
IoT Hub needs write access to these service endpoints for message routing to work. If you configure your endpoints through the Azure portal, the necessary permissions are added for you. If you configure your endpoints using PowerShell or the Azure CLI, you need to provide the write access permission.
4444

45-
To learn how to create endpoints, see the following articles:
45+
To learn how to create endpoints, see [Manage routes and endpoints using the Azure portal](how-to-routing-portal.md).
4646

47-
* [Manage routes and endpoints using the Azure portal](how-to-routing-portal.md)
48-
* [Manage routes and endpoints using the Azure CLI](how-to-routing-azure-cli.md)
49-
* [Manage routes and endpoints using PowerShell](how-to-routing-powershell.md)
50-
* [Manage routes and endpoints using Azure Resource Manager](how-to-routing-arm.md)
51-
52-
Make sure that you configure your services to support the expected throughput. For example, if you're using Event Hubs as a custom endpoint, you must configure the **throughput units** for that event hub so that it can handle the ingress of events you plan to send via IoT Hub message routing. Similarly, when using a Service Bus queue as an endpoint, you must configure the **maximum size** to ensure the queue can hold all the data ingressed, until it's egressed by consumers. When you first configure your IoT solution, you may need to monitor your other endpoints and make any necessary adjustments for the actual load.
47+
Make sure that you configure your services to support the expected throughput. For example, if you're using Event Hubs as a custom endpoint, you must configure the **throughput units** for that event hub so that it can handle the ingress of events you plan to send via IoT Hub message routing. Similarly, when using a Service Bus queue as an endpoint, you must configure the **maximum size** to ensure the queue can hold all the data ingressed, until it's egressed by consumers. When you first configure your IoT solution, you might need to monitor your other endpoints and make adjustments for the actual load.
5348

5449
If your custom endpoint has firewall configurations, consider using the [Microsoft trusted first party exception.](./virtual-network-support.md#egress-connectivity-from-iot-hub-to-other-azure-resources)
5550

@@ -61,7 +56,7 @@ For more information, see [Egress connectivity from IoT Hub to other Azure resou
6156

6257
## Routing queries
6358

64-
IoT Hub message routing provides a querying capability to filter the data before routing it to the endpoints. Each routing query you configure has the following properties:
59+
IoT Hub message routing provides a querying capability to filter the data before routing it to the endpoints. Each routing query has the following properties:
6560

6661
| Property | Description |
6762
| ------------- | ----------- |
@@ -70,11 +65,11 @@ IoT Hub message routing provides a querying capability to filter the data before
7065
| **Condition** | The query expression for the routing query that is run against the message application properties, system properties, message body, device twin tags, and device twin properties to determine if it's a match for the endpoint. |
7166
| **Endpoint** | The name of the endpoint where IoT Hub sends messages that match the query. We recommend that you choose an endpoint in the same region as your IoT hub. |
7267

73-
A single message may match the condition on multiple routing queries, in which case IoT Hub delivers the message to the endpoint associated with each matched query. IoT Hub also automatically deduplicates message delivery, so if a message matches multiple queries that have the same destination, it's only written once to that destination.
68+
A single message can match the condition on multiple routing queries, in which case IoT Hub delivers the message to the endpoint associated with each matched query. IoT Hub also automatically deduplicates message delivery. If a message matches multiple queries that have the same destination, IoT Hub only delivers it once to that destination.
7469

7570
For more information, see [IoT Hub message routing query syntax](./iot-hub-devguide-routing-query-syntax.md).
7671

77-
## Read data that has been routed
72+
## Read routed data
7873

7974
Use the following articles to learn how to read messages from an endpoint.
8075

@@ -90,13 +85,13 @@ Use the following articles to learn how to read messages from an endpoint.
9085

9186
## Fallback route
9287

93-
The fallback route sends all the messages that don't satisfy query conditions on any of the existing routes to the built-in endpoint (**messages/events**), which is compatible with [Event Hubs](../event-hubs/index.yml). If message routing is enabled, you can enable the fallback route capability. Once any route is created, data stops flowing to the built-in endpoint, unless a route is created to that endpoint. If there are no routes to the built-in endpoint and a fallback route is enabled, only messages that don't match any query conditions on routes will be sent to the built-in endpoint. Even if all existing routes are deleted, the fallback route capability must be enabled to receive all data at the built-in endpoint.
88+
The fallback route sends all the messages that don't satisfy query conditions on any of the existing routes to the built-in endpoint (**messages/events**), which is compatible with [Event Hubs](../event-hubs/index.yml). If message routing is enabled, you can enable the fallback route capability. Once any route is created, data stops flowing to the built-in endpoint, unless a route is created to that endpoint. If there are no routes to the built-in endpoint and a fallback route is enabled, only messages that don't match any query conditions on routes are sent to the built-in endpoint. Even if all existing routes are deleted, the fallback route capability must be enabled to receive all data at the built-in endpoint.
9489

95-
You can enable or disable the fallback route in the Azure portal on the **Message routing** blade. You can also use Azure Resource Manager for [FallbackRouteProperties](/rest/api/iothub/iothubresource/createorupdate#fallbackrouteproperties) to use a custom endpoint for the fallback route.
90+
You can enable or disable the fallback route in the Azure portal on the **Message routing** page. You can also use Azure Resource Manager for [FallbackRouteProperties](/rest/api/iothub/iothubresource/createorupdate#fallbackrouteproperties) to use a custom endpoint for the fallback route.
9691

9792
## Non-telemetry events
9893

99-
In addition to device telemetry, message routing also enables sending non-telemetry events, including:
94+
In addition to device telemetry, message routing also enables sending nontelemetry events, including:
10095

10196
* Device twin change events
10297
* Device lifecycle events
@@ -108,11 +103,11 @@ For example, if a route is created with the data source set to **Device Twin Cha
108103

109104
When using [Azure IoT Plug and Play](../iot/overview-iot-plug-and-play.md), a developer can create routes with the data source set to **Digital Twin Change Events** and IoT Hub sends messages whenever a digital twin property is set or changed, a digital twin is replaced, or when a change event happens for the underlying device twin. Finally, if a route is created with data source set to **Device Connection State Events**, IoT Hub sends a message indicating whether the device was connected or disconnected.
110105

111-
IoT Hub also integrates with Azure Event Grid to publish device events to support real-time integrations and automation of workflows based on these events. See key [differences between message routing and Event Grid](iot-hub-event-grid-routing-comparison.md) to learn which works best for your scenario.
106+
IoT Hub also integrates with Azure Event Grid to publish device events to support real-time integrations and automation of workflows based on these events. To learn which service works best for your scenario, see [differences between message routing and Event Grid](iot-hub-event-grid-routing-comparison.md).
112107

113108
### Limitations for device connection state events
114109

115-
Device connection state 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. For IoT Hub to start sending device connection state events, after opening a connection a device must call either the *cloud-to-device receive message* operation or the *device-to-cloud send telemetry* operation. Outside of the Azure IoT SDKs, in MQTT these operations equate to SUBSCRIBE or PUBLISH operations on the appropriate messaging topics. Over AMQP these operations equate to attaching or transferring a message on the appropriate link paths. For more information, see the following articles:
110+
Device connection state 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. For IoT Hub to start sending device connection state events, after opening a connection a device must call either the *cloud-to-device receive message* operation or the *device-to-cloud send telemetry* operation. Outside of the Azure IoT SDKs, in MQTT these operations equate to SUBSCRIBE or PUBLISH operations on the appropriate messaging topics. Over AMQP these operations equate to attaching or transferring a message on the appropriate link paths. For more information, see the following articles:
116111

117112
* [Communicate with IoT Hub using MQTT](../iot/iot-mqtt-connect-to-iot-hub.md)
118113
* [Communicate with IoT Hub using AMQP](iot-hub-amqp-support.md)
@@ -127,7 +122,7 @@ When you create a new route or edit an existing route, you should test the route
127122

128123
When you route device-to-cloud telemetry messages, there's a slight increase in the end-to-end latency after the creation of the first route.
129124

130-
In most cases, the average increase in latency is less than 500 milliseconds. However, the latency you experience can vary and can be higher depending on the tier of your IoT hub and your solution architecture. You can monitor the latency using the **Routing: message latency for messages/events** or **d2c.endpoints.latency.builtIn.events** IoT Hub metrics. Creating or deleting any route after the first one doesn't impact the end-to-end latency.
125+
In most cases, the average increase in latency is less than 500 milliseconds. However, the latency you experience can vary and can be higher depending on the tier of your IoT hub and your solution architecture. You can monitor the latency using the **Routing: message latency for messages/events** or **d2c.endpoints.latency.builtIn.events** IoT Hub metrics. Creating or deleting any route after the first one doesn't affect the end-to-end latency.
131126

132127
## Monitor and troubleshoot
133128

0 commit comments

Comments
 (0)