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/healthcare-apis/iot/device-data-through-iot-hub.md
+23-23Lines changed: 23 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,20 @@ author: msjasteppe
6
6
ms.service: healthcare-apis
7
7
ms.subservice: iomt
8
8
ms.topic: tutorial
9
-
ms.date: 12/15/2022
9
+
ms.date: 12/22/2022
10
10
ms.author: jasteppe
11
11
---
12
12
13
13
# Tutorial: Receive device messages through Azure IoT Hub
14
14
15
15
For enhanced workflows and ease of use, you can use the MedTech service to receive messages from devices you create and manage through an IoT hub in [Azure IoT Hub](../../iot-hub/iot-concepts-and-iot-hub.md). This tutorial uses an Azure Resource Manager template (ARM template) and a **Deploy to Azure** button to deploy a MedTech service. The template creates an IoT hub to create and manage devices, and then routes device messages to an event hub in Azure Event Hubs for the MedTech service to pick up.
16
16
17
+
:::image type="content" source="media\device-data-through-iot-hub\data-flow-diagram.png" border="false" alt-text="Diagram of the IoT message data flow through an IoT hub and event hub, and then into the MedTech service." lightbox="media\device-data-through-iot-hub\data-flow-diagram.png":::
18
+
19
+
> [!TIP]
20
+
> To learn more about how the MedTech service transforms and persists device messages into the Fast Healthcare Interoperability Resources (FHIR®) service as FHIR Observations, see [The MedTech service data flow](data-flow.md).
21
+
22
+
17
23
In this tutorial, you learn how to:
18
24
19
25
> [!div class="checklist"]
@@ -26,12 +32,6 @@ In this tutorial, you learn how to:
26
32
> [!TIP]
27
33
> To learn more about ARM templates, see [What are ARM templates?](./../../azure-resource-manager/templates/overview.md)
28
34
29
-
## Device message flow
30
-
31
-
The following diagram demonstrates the IoT device message flow when you use an IoT hub in Azure IoT Hub with the MedTech service in Azure Health Data Services. Devices send messages to your IoT hub. Your IoT hub routes the device messages to the device message event hub in Azure Event Hubs for the MedTech service to pick up. The MedTech service transforms the device messages and persists them in the Fast Healthcare Interoperability Resources (FHIR®) service as FHIR observations. For more information, see [MedTech service data flow](data-flow.md).
32
-
33
-
:::image type="content" source="media\iot-hub-to-iot-connector\iot-hub-to-iot-connector.png" border="false" alt-text="Diagram of the IoT message data flow through an IoT hub and event hub, and then into the MedTech service." lightbox="media\iot-hub-to-iot-connector\iot-hub-to-iot-connector.png":::
34
-
35
35
## Prerequisites
36
36
37
37
To begin your deployment and complete the tutorial, you must have the following prerequisites:
@@ -82,23 +82,23 @@ To begin deployment in the Azure portal, select the **Deploy to Azure** button:
82
82
83
83
-**Destination Mapping**: Don't change the default values for this tutorial. The mappings are set in the template to send a device message to your IoT hub later in the tutorial.
84
84
85
-
:::image type="content" source="media\iot-hub-to-iot-connector\iot-deploy-template-options.png" alt-text="Screenshot that shows deployment options for the MedTech service for Health Data Services in the Azure portal." lightbox="media\iot-hub-to-iot-connector\iot-deploy-template-options.png":::
85
+
:::image type="content" source="media\device-data-through-iot-hub\deploy-template-options.png" alt-text="Screenshot that shows deployment options for the MedTech service for Health Data Services in the Azure portal." lightbox="media\device-data-through-iot-hub\deploy-template-options.png":::
86
86
87
87
2. To validate your configuration, select **Review + create**.
88
88
89
-
:::image type="content" source="media\iot-hub-to-iot-connector\iot-review-and-create-button.png" alt-text="Screenshot that shows the Review + create button selected in the Azure portal.":::
89
+
:::image type="content" source="media\device-data-through-iot-hub\review-and-create-button.png" alt-text="Screenshot that shows the Review + create button selected in the Azure portal.":::
90
90
91
91
3. In **Review + create**, check the template validation status. If validation is successful, the template displays **Validation Passed**. If validation fails, fix the detail that's indicated in the error message, and then select **Review + create** again.
92
92
93
-
:::image type="content" source="media\iot-hub-to-iot-connector\iot-validation-completed.png" alt-text="Screenshot that shows the Review + create pane displaying the Validation Passed message.":::
93
+
:::image type="content" source="media\device-data-through-iot-hub\validation-complete.png" alt-text="Screenshot that shows the Review + create pane displaying the Validation Passed message.":::
94
94
95
95
4. After a successful validation, to begin the deployment, select **Create**.
96
96
97
-
:::image type="content" source="media\iot-hub-to-iot-connector\iot-create-button.png" alt-text="Screenshot that shows the highlighted Create button.":::
97
+
:::image type="content" source="media\device-data-through-iot-hub\create-button.png" alt-text="Screenshot that shows the highlighted Create button.":::
98
98
99
99
5. In a few minutes, the Azure portal displays the message that your deployment is completed.
100
100
101
-
:::image type="content" source="media\iot-hub-to-iot-connector\iot-deployment-complete-banner.png" alt-text="Screenshot that shows a green checkmark and the message Your deployment is complete.":::
101
+
:::image type="content" source="media\device-data-through-iot-hub\deployment-complete-banner.png" alt-text="Screenshot that shows a green checkmark and the message Your deployment is complete.":::
102
102
103
103
> [!IMPORTANT]
104
104
> If you're going to allow access from multiple services to the device message event hub, it is highly recommended that each service has its own event hub consumer group.
@@ -119,17 +119,17 @@ When deployment is completed, the following resources and access roles are creat
119
119
120
120
- An event hub consumer group. In this deployment, the consumer group is named *$Default*.
121
121
122
-
-The Azure Event Hubs Data Sender role. In this deployment, the role is named *devicedatasender*. The Azure Event Hubs Data Sender role isn't used in this tutorial. To learn more about the role, see [Review of deployed resources and access permissions](deploy-02-new-button.md#required-post-deployment-tasks).
122
+
-An Azure Event Hubs Data Sender role. In this deployment, the role is named *devicedatasender*. The Azure Event Hubs Data Sender role isn't used in this tutorial.
123
123
124
-
- An instance of Azure IoT Hub with [message routing](../../iot-hub/iot-hub-devguide-messages-d2c.md) configured to send device messages to the device message event hub.
124
+
- An Azure IoT Hub with [message routing](../../iot-hub/iot-hub-devguide-messages-d2c.md) configured to send device messages to the device message event hub.
125
125
126
126
- A [user-assigned managed identity](../../active-directory/managed-identities-azure-resources/overview.md) that provides send access from the IoT hub to the device message event hub. The managed identity has the Azure Event Hubs Data Sender role in the [Access control section (IAM)](../../role-based-access-control/overview.md) of the device message event hub.
127
127
128
128
- A Health Data Services workspace.
129
129
130
130
- A Health Data Services FHIR service.
131
131
132
-
-An instance of the MedTech service for Health Data Services, with the required [system-assigned managed identity](../../active-directory/managed-identities-azure-resources/overview.md) roles:
132
+
-A Health Data Services MedTech service with the required [system-assigned managed identity](../../active-directory/managed-identities-azure-resources/overview.md) access roles:
133
133
134
134
- For the device message event hub, the Azure Events Hubs Data Receiver role is assigned in the [Access control section (IAM)](../../role-based-access-control/overview.md) of the device message event hub.
135
135
@@ -156,22 +156,22 @@ You complete the steps by using Visual Studio Code with the Azure IoT Hub extens
156
156
157
157
2. In Explorer, in **Azure IoT Hub**, select **…** and choose **Select IoT Hub**.
158
158
159
-
:::image type="content" source="media\iot-hub-to-iot-connector\iot-select-iot-hub.png" alt-text="Screenshot of Visual Studio Code with the Azure IoT Hub extension with the deployed IoT hub selected." lightbox="media\iot-hub-to-iot-connector\iot-select-iot-hub.png":::
159
+
:::image type="content" source="media\device-data-through-iot-hub\select-iot-hub.png" alt-text="Screenshot of Visual Studio Code with the Azure IoT Hub extension with the deployed IoT hub selected." lightbox="media\device-data-through-iot-hub\select-iot-hub.png":::
160
160
161
161
3. Select the Azure subscription where your IoT hub was provisioned.
162
162
163
163
4. Select your IoT hub. The name of your IoT hub is the *basename* you provided when you provisioned the resources prefixed with **ih-**. An example hub name is *ih-azuredocsdemo*.
164
164
165
165
5. In Explorer, in **Azure IoT Hub**, select **…** and choose **Create Device**. An example device name is *iot-001*.
166
166
167
-
:::image type="content" source="media\iot-hub-to-iot-connector\iot-create-device.png" alt-text="Screenshot that shows Visual Studio Code with the Azure IoT Hub extension with Create device selected." lightbox="media\iot-hub-to-iot-connector\iot-create-device.png":::
167
+
:::image type="content" source="media\device-data-through-iot-hub\create-device.png" alt-text="Screenshot that shows Visual Studio Code with the Azure IoT Hub extension with Create device selected." lightbox="media\device-data-through-iot-hub\create-device.png":::
168
168
169
169
6. To send a test message from the device to your IoT hub, right-click the device and select **Send D2C Message to IoT Hub**.
170
170
171
171
> [!NOTE]
172
-
> In this device-to-cloud (D2C) example, *cloud* is the IoT hub in Azure IoT Hub that receives the device message. Azure IoT Hub supports two-way communications. To set up a cloud-to-device (C2D) scenario, select **Send C2D Message to Device Cloud**.
172
+
> In this device-to-cloud (D2C) example, *cloud* is the IoT hub in the Azure IoT Hub that receives the device message. Azure IoT Hub supports two-way communications. To set up a cloud-to-device (C2D) scenario, select **Send C2D Message to Device Cloud**.
173
173
174
-
:::image type="content" source="media\iot-hub-to-iot-connector\iot-select-device-to-cloud-message.png" alt-text="Screenshot that shows Visual Studio Code with the Azure IoT Hub extension and the Send D2C Message to IoT Hub option selected." lightbox="media\iot-hub-to-iot-connector\iot-select-device-to-cloud-message.png":::
174
+
:::image type="content" source="media\device-data-through-iot-hub\select-device-to-cloud-message.png" alt-text="Screenshot that shows Visual Studio Code with the Azure IoT Hub extension and the Send D2C Message to IoT Hub option selected." lightbox="media\device-data-through-iot-hub\select-device-to-cloud-message.png":::
175
175
176
176
7. In **Send D2C Messages**, select or enter the following values:
177
177
@@ -186,7 +186,7 @@ You complete the steps by using Visual Studio Code with the Azure IoT Hub extens
186
186
-**Edit**: Clear any existing text, and then paste the following JSON.
187
187
188
188
> [!TIP]
189
-
> You can use the **Copy** option in in the right corner of the test message, and then paste it in **Edit**.
189
+
> You can use the **Copy** option in in the right corner of the below test message, and then paste it within the **Edit** option.
190
190
191
191
```json
192
192
{
@@ -203,7 +203,7 @@ You complete the steps by using Visual Studio Code with the Azure IoT Hub extens
203
203
204
204
8. To begin the process of sending a test message to your IoT hub, select **Send**.
205
205
206
-
:::image type="content" source="media\iot-hub-to-iot-connector\iot-select-device-to-cloud-message-options.png" alt-text="Screenshot that shows Visual Studio code with the Azure IoT Hub extension with the device message options selected." lightbox="media\iot-hub-to-iot-connector\iot-select-device-to-cloud-message-options.png":::
206
+
:::image type="content" source="media\device-data-through-iot-hub\select-device-to-cloud-message-options.png" alt-text="Screenshot that shows Visual Studio code with the Azure IoT Hub extension with the device message options selected." lightbox="media\device-data-through-iot-hub\select-device-to-cloud-message-options.png":::
207
207
208
208
After you select **Send**, it might take up to five minutes for the FHIR resources to be available in the FHIR service.
209
209
@@ -221,9 +221,9 @@ For your MedTech service metrics, you can see that your MedTech service complete
221
221
- **Number of Measurements**: Created five measurements.
222
222
- **Number of FHIR resources**: Created five FHIR resources that are persisted in your FHIR service.
223
223
224
-
:::image type="content" source="media\iot-hub-to-iot-connector\iot-metrics-tile-one.png" alt-text="Screenshot that shows a MedTech service metrics tile and test data metrics." lightbox="media\iot-hub-to-iot-connector\iot-metrics-tile-one.png":::
224
+
:::image type="content" source="media\device-data-through-iot-hub\metrics-tile-one.png" alt-text="Screenshot that shows a MedTech service metrics tile and test data metrics." lightbox="media\device-data-through-iot-hub\metrics-tile-one.png":::
225
225
226
-
:::image type="content" source="media\iot-hub-to-iot-connector\iot-metrics-tile-two.png" alt-text="Screenshot that shows a second MedTech service metrics tile and test data metrics." lightbox="media\iot-hub-to-iot-connector\iot-metrics-tile-two.png":::
226
+
:::image type="content" source="media\device-data-through-iot-hub\metrics-tile-two.png" alt-text="Screenshot that shows a second MedTech service metrics tile and test data metrics." lightbox="media\device-data-through-iot-hub\metrics-tile-two.png":::
0 commit comments