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
Copy file name to clipboardExpand all lines: articles/iot-hub/iot-concepts-and-iot-hub.md
+14-21Lines changed: 14 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,13 @@ ms.author: kgremban
7
7
ms.service: azure-iot-hub
8
8
services: iot-hub
9
9
ms.topic: overview
10
-
ms.date: 02/22/2024
10
+
ms.date: 02/27/2025
11
11
#Customer intent: As a developer new to IoT Hub, learn the basic concepts.
12
12
---
13
13
14
14
# What is Azure IoT Hub?
15
15
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.
17
17
18
18
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.
19
19
@@ -23,24 +23,21 @@ IoT Hub scales to millions of simultaneously connected devices and millions of e
23
23
24
24
You can integrate IoT Hub with other Azure services to build complete, end-to-end solutions. For example, use:
25
25
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.
28
27
-[Azure Logic Apps](../logic-apps/index.yml) to automate business processes.
29
-
30
28
-[Azure Machine Learning](/azure/machine-learning/) to add machine learning and AI models to your solution.
31
-
32
29
-[Azure Stream Analytics](../stream-analytics/index.yml) to run real-time analytic computations on the data streaming from your devices.
33
30
34
31
## IoT devices
35
32
36
33
IoT devices differ from other clients such as browsers and mobile apps. Specifically, IoT devices:
37
34
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
44
41
45
42
## Device identity and authentication
46
43
@@ -62,7 +59,7 @@ Typically, IoT devices send data from the sensors to back-end services in the cl
62
59
63
60
- A refrigeration truck sending temperature every 5 minutes to an IoT hub.
64
61
- 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.
66
63
67
64
For more information, see [Device infrastructure and connectivity](../iot/iot-overview-device-connectivity.md).
68
65
@@ -78,7 +75,7 @@ You can enable properties in IoT Hub using [Device twins](iot-hub-devguide-devic
78
75
79
76
## Device commands
80
77
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.
82
79
83
80
## Act on device data
84
81
@@ -103,21 +100,17 @@ For more information about IoT Hub endpoints, see [IoT Hub endpoints](iot-hub-de
103
100
104
101
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).
105
102
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.
109
104
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).
111
106
112
107
## Next steps
113
108
114
109
To try out an end-to-end IoT solution, check out the IoT Hub quickstarts:
115
110
116
111
-[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)
119
113
120
114
To learn more about the ways you can build and deploy IoT solutions with Azure IoT, visit:
121
115
122
116
-[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)
Copy file name to clipboardExpand all lines: articles/iot-hub/iot-hub-devguide-messages-d2c.md
+13-18Lines changed: 13 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
---
2
2
title: Understand Azure IoT Hub message routing
3
3
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.
@@ -42,14 +42,9 @@ Each message is routed to all endpoints whose routing queries it matches, which
42
42
43
43
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.
44
44
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).
46
46
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.
53
48
54
49
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)
55
50
@@ -61,7 +56,7 @@ For more information, see [Egress connectivity from IoT Hub to other Azure resou
61
56
62
57
## Routing queries
63
58
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:
65
60
66
61
| Property | Description |
67
62
| ------------- | ----------- |
@@ -70,11 +65,11 @@ IoT Hub message routing provides a querying capability to filter the data before
70
65
|**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. |
71
66
|**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. |
72
67
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.
74
69
75
70
For more information, see [IoT Hub message routing query syntax](./iot-hub-devguide-routing-query-syntax.md).
76
71
77
-
## Read data that has been routed
72
+
## Read routed data
78
73
79
74
Use the following articles to learn how to read messages from an endpoint.
80
75
@@ -90,13 +85,13 @@ Use the following articles to learn how to read messages from an endpoint.
90
85
91
86
## Fallback route
92
87
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.
94
89
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.
96
91
97
92
## Non-telemetry events
98
93
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:
100
95
101
96
* Device twin change events
102
97
* Device lifecycle events
@@ -108,11 +103,11 @@ For example, if a route is created with the data source set to **Device Twin Cha
108
103
109
104
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.
110
105
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).
112
107
113
108
### Limitations for device connection state events
114
109
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:
116
111
117
112
*[Communicate with IoT Hub using MQTT](../iot/iot-mqtt-connect-to-iot-hub.md)
118
113
*[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
127
122
128
123
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.
129
124
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.
0 commit comments