Skip to content

Commit 40fbaf2

Browse files
authored
Merge pull request #300322 from DENKEN02MSFT/Top50_sonialopez_Row49
Top50 - row 49
2 parents f2e29f6 + 1d08da5 commit 40fbaf2

File tree

3 files changed

+31
-30
lines changed

3 files changed

+31
-30
lines changed

articles/iot-hub/iot-hub-device-streams-overview.md

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
---
22
title: Azure IoT Hub device streams | Microsoft Docs
3-
description: Overview of Azure IoT Hub device streams, which facilitate secure bi-directional TCP tunnels for a variety of cloud-to-device communication scenarios.
3+
description: Overview of Azure IoT Hub device streams, which facilitate secure bi-directional TCP tunnels for various cloud-to-device communication scenarios.
44
author: SoniaLopezBravo
55
services: iot-hub
66
ms.service: azure-iot-hub
7-
ms.topic: conceptual
8-
ms.date: 01/15/2019
7+
ms.topic: concept-article
8+
ms.date: 05/23/2025
99
ms.author: sonialopez
1010
ms.custom: ['Role: Cloud Development','Role: IoT Device','Role: Technical Support']
1111
---
1212

1313
# IoT Hub Device Streams (preview)
1414

15-
Azure IoT Hub *device streams* facilitate the creation of secure bi-directional TCP tunnels for various cloud-to-device communication scenarios. A device stream is mediated by an IoT Hub *streaming endpoint, which acts as a proxy between your device and service endpoints. This setup, depicted in the diagram, is especially useful when devices are behind a network firewall or reside inside of a private network. As such, IoT Hub device streams help address customers' need to reach IoT devices in a firewall-friendly manner and without the need to broadly opening up incoming or outgoing network firewall ports.
15+
Azure IoT Hub *device streams* facilitate the creation of secure bi-directional TCP tunnels for various cloud-to-device communication scenarios. An IoT Hub *streaming endpoint* mediates device streams, acting as a proxy between your device and service endpoints. This setup, depicted in the following diagram, is especially useful when devices are behind a network firewall or reside inside of a private network. As such, IoT Hub device streams help address customers' need to reach IoT devices in a firewall-friendly manner and without the need to broadly opening up incoming or outgoing network firewall ports.
1616

17-
!["IoT Hub device streams overview"](./media/iot-hub-device-streams-overview/iot-hub-device-streams-overview.png)
17+
:::image type="content" source="./media/iot-hub-device-streams-overview/iot-hub-device-streams-overview.png" alt-text="Diagram that shows an overview of IoT Hub device streams.":::
1818

19-
Using IoT Hub device streams, devices remain secure and will only need to open up outbound TCP connections to IoT hub's streaming endpoint over port 443. Once a stream is established, the service-side and device-side applications each have programmatic access to a WebSocket client object to send and receive raw bytes to one another. The reliability and ordering guarantees provided by this tunnel is on par with TCP.
19+
Devices that use IoT Hub device streams can remain secure and only need to open up outbound TCP connections to your IoT hub's streaming endpoint over port 443. Once a stream is established, the service-side and device-side applications each have programmatic access to a WebSocket client object to send and receive raw bytes to one another. The reliability and ordering guarantees provided by this tunnel is on par with TCP.
2020

2121
## Benefits
2222

@@ -44,7 +44,7 @@ The device stream creation process involves a negotiation between the device, se
4444

4545
Programmatic creation of a device stream using the SDK involves the following steps, which are also depicted in the figure:
4646

47-
!["Device stream handshake process"](./media/iot-hub-device-streams-overview/iot-hub-device-streams-handshake.png)
47+
:::image type="content" source="./media/iot-hub-device-streams-overview/iot-hub-device-streams-handshake.png" alt-text="Diagram that shows the steps of the handshake process for an IoT Hub device stream.":::
4848

4949
1. The device application registers a callback in advance to be notified of when a new device stream is initiated to the device. This step typically takes place when the device boots up and connects to IoT Hub.
5050

@@ -56,27 +56,27 @@ Programmatic creation of a device stream using the SDK involves the following st
5656

5757
5. The service is notified of the result of device accepting the stream and proceeds to create its own WebSocket client to the streaming endpoint. Similarly, it receives the streaming endpoint URL and authentication information from IoT Hub.
5858

59-
In the handshake process above:
59+
In the previously described handshake process:
6060

61-
* The handshake process must complete within 60 seconds (step 2 through 5), otherwise the handshake would fail with a timeout and the service will be notified accordingly.
61+
* The handshake process must complete within 60 seconds (step 2 through 5), otherwise the handshake fails with a timeout and the service is notified accordingly.
6262

63-
* After the stream creation flow above completes, the streaming endpoint will act as a proxy and will transfer traffic between the service and the device over their respective WebSockets.
63+
* After the previously described stream creation flow completes, the streaming endpoint acts as a proxy and transfers traffic between the service and the device over their respective WebSockets.
6464

6565
* Device and service both need outbound connectivity to IoT Hub's main endpoint and the streaming endpoint over port 443. The URL of these endpoints is available on *Overview* tab on the IoT Hub's portal.
6666

6767
* The reliability and ordering guarantees of an established stream is on par with TCP.
6868

69-
* All connections to IoT Hub and streaming endpoint use TLS and are encrypted.
69+
* All connections to IoT Hub and its streaming endpoint use TLS and are encrypted.
7070

7171
### Termination flow
7272

7373
An established stream terminates when either of the TCP connections to the gateway are disconnected (by the service or device). This action can take place voluntarily by closing the WebSocket on either the device or service programs, or involuntarily if a network connectivity timeout or process failure. Upon termination of either device or service's connection to the streaming endpoint, the other TCP connection is also (forcefully) terminated and the service and device are responsible to re-create the stream, if needed.
7474

7575
## Connectivity requirements
7676

77-
Both the device and the service sides of a device stream must be capable of establishing TLS-enabled connections to IoT Hub and its streaming endpoint. This situation requires outbound connectivity over port 443 to these endpoints. The hostname associated with these endpoints can be found on the *Overview* tab of IoT Hub, as shown in the figure:
77+
Both the device and the service sides of a device stream must be capable of establishing TLS-enabled connections to IoT Hub and its streaming endpoint. This situation requires outbound connectivity over port 443 to these endpoints. The hostname associated with the streaming endpoint can be found on the overview pane of your IoT hub in Azure portal, as shown in the following screenshot.
7878

79-
!["Device stream endpoints"](./media/iot-hub-device-streams-overview/device-stream-in-portal.png)
79+
:::image type="content" source="./media/iot-hub-device-streams-overview/device-stream-in-portal.png" alt-text="Screenshot of the working pane for an IoT hub in Azure portal, highlighting the hostname for device streaming endpoints.":::
8080

8181
Alternatively, the endpoints information can be retrieved using Azure CLI under the hub's properties section, specifically, `property.hostname` and `property.deviceStreams` keys.
8282

@@ -95,45 +95,46 @@ The output is a JSON object of all endpoints that your hub's device and service
9595
```
9696

9797
> [!NOTE]
98-
> Ensure you have installed Azure CLI version 2.0.57 or newer. You can download the latest version from the [Install Azure CLI](/cli/azure/install-azure-cli) page.
98+
> Ensure that you install Azure CLI version 2.73.0 or newer. You can download the latest version from the [Install Azure CLI](/cli/azure/install-azure-cli) page.
9999
>
100100
101101
## Allow outbound connectivity to the device streaming endpoints
102102

103-
As mentioned at the beginning of this article, your device creates an outbound connection to IoT Hub streaming endpoint during device streams initiation process. Your firewalls on the device or its network must allow outbound connectivity to the streaming gateway over port 443 (note that communication takes place over a WebSocket connection that is encrypted using TLS).
103+
As mentioned at the beginning of this article, your device creates an outbound connection to the IoT Hub streaming endpoint during device streams initiation process. Your firewalls on the device or its network must allow outbound connectivity to the streaming gateway over port 443 (note that communication takes place over a WebSocket connection that is encrypted using TLS).
104104

105-
The hostname of device streaming endpoint can be found on the Azure IoT Hub portal under the Overview tab.
106-
!["Device stream endpoints"](./media/iot-hub-device-streams-overview/device-stream-in-portal.png)
105+
The hostname associated with the streaming endpoint can be found on the overview pane of your IoT hub in Azure portal, as shown in the following screenshot.
107106

108-
Alternatively, you can find this information using Azure CLI:
107+
:::image type="content" source="./media/iot-hub-device-streams-overview/device-stream-in-portal.png" alt-text="Screenshot of the working pane for an IoT hub in Azure portal, highlighting the hostname for device streaming endpoints.":::
108+
109+
Alternatively, you can find this information by using the Azure CLI, as shown in the following example:
109110

110111
```azurecli-interactive
111112
az iot hub devicestream show --name <YourIoTHubName>
112113
```
113114

114115
> [!NOTE]
115-
> Ensure you have installed Azure CLI version 2.0.57 or newer. You can download the latest version from the [Install Azure CLI](/cli/azure/install-azure-cli) page.
116+
> Ensure that you install Azure CLI version 2.73.0 or newer. You can download the latest version from the [Install Azure CLI](/cli/azure/install-azure-cli) page.
116117
>
117118
118119
## Troubleshoot via Device Streams resource logs
119120

120-
You can set up Azure Monitor to collect the [resource logs for device streams](monitor-iot-hub-reference.md#device-streams-category-preview) emitted by your IoT Hub. This approach can be helpful in troubleshooting scenarios.
121+
You can set up Azure Monitor to collect the [resource logs for device streams](monitor-iot-hub-reference.md#device-streams-category-preview) emitted by your IoT hub. This approach can be helpful in troubleshooting scenarios.
121122

122-
Follow these steps to create a diagnostics setting to send device streams logs for your IoT Hub to Azure Monitor Logs:
123+
Follow these steps to create a diagnostics setting to send Device Streams resource logs for your IoT hub to Azure Monitor Logs:
123124

124-
1. In Azure portal, navigate to your IoT hub. On the left pane, under **Monitoring**, select **Diagnostic settings**. Then select **Add diagnostic setting**.
125+
1. In Azure portal, navigate to your IoT hub. On the left pane, under **Monitoring**, select **Diagnostic settings**. Then, select **Add diagnostic setting**.
125126

126-
2. Provide a name for your diagnostics setting and select **DeviceStreams** from the list of logs. Then select **Send to Log Analytics**. You'll be guided to choose an existing Log Analytics workspace or create a new one.
127+
2. Provide a name for your diagnostics setting and select **Device Streams (Preview)** from the list of logs. Then select **Send to Log Analytics workspace**. You're guided to choose an existing Log Analytics workspace or create a new one.
127128

128-
:::image type="content" source="media/iot-hub-device-streams-overview/device-streams-configure-diagnostics.png" alt-text="Enable device streams logs":::
129+
:::image type="content" source="./media/iot-hub-device-streams-overview/device-streams-configure-diagnostics.png" alt-text="Screenshot that shows the Diagnostics setting pane in Azure portal, highlighting settings for Device Streams resource logs.":::
129130

130-
3. After you create a diagnostic setting to send your device streams logs to a Log Analytics workspace, you can access the logs by selecting **Logs** under **Monitoring** on the left pane of your IoT hub in Azure portal. Device streams logs appear in the `AzureDiagnostics` table and have `Category=DeviceStreams`. It might take several minutes following an operation for logs to appear in the table.
131+
3. After you create a diagnostic setting to send your Device Streams resource logs to a Log Analytics workspace, you can access the logs by selecting **Logs** under **Monitoring** on the left pane of your IoT hub in Azure portal. Device Streams resource logs appear in the `AzureDiagnostics` table and have `Category=DeviceStreams`. It might take several minutes following an operation for logs to appear in the table.
131132

132133
As shown here, the identity of the target device and the result of the operation is also available in the logs.
133134

134-
!["Access device stream logs"](./media/iot-hub-device-streams-overview/device-streams-view-logs.png)
135+
:::image type="content" source="./media/iot-hub-device-streams-overview/device-streams-view-logs.png" alt-text="Screenshot that shows the AzureDiagnostic logs for an IoT hub, highlighting the identity, operation, and results for a Device Streams resource log entry.":::
135136

136-
To learn more about using Azure Monitor with IoT Hub, see [Monitor IoT Hub](monitor-iot-hub.md). For information about all of the resource logs, metrics, and tables available for IoT Hub, see [Monitoring Azure IoT Hub data reference](monitor-iot-hub-reference.md).
137+
To learn more about using Azure Monitor with IoT Hub, see [Monitor Azure IoT Hub](monitor-iot-hub.md). For information about all of the resource logs, metrics, and tables available for IoT Hub, see [Azure IoT Hub monitoring data reference](monitor-iot-hub-reference.md).
137138

138139
## Regional availability
139140

@@ -143,11 +144,11 @@ During public preview, IoT Hub device streams are available in the Central US, E
143144

144145
Two sides of each stream (on the device and service side) use the IoT Hub SDK to establish the tunnel. During public preview, customers can choose from the following SDK languages:
145146

146-
* The C and C# SDK's support device streams on the device side.
147+
* The C and C# SDKs support device streams on the device side.
147148

148-
* The Node.js and C# SDK support device streams on the service side.
149+
* The Node.js and C# SDKs support device streams on the service side.
149150

150151
## Next steps
151152

152153
> [!div class="nextstepaction"]
153-
> [Azure IoT Hub Device Streams Video](/shows/Internet-of-Things-Show/Azure-IoT-Hub-Device-Streams)
154+
> [Azure IoT Hub Device Streams video](/shows/Internet-of-Things-Show/Azure-IoT-Hub-Device-Streams)
18.6 KB
Loading
18.8 KB
Loading

0 commit comments

Comments
 (0)