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/twin-getstarted-cli.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Get started with Azure IoT Hub device twins (Azure CLI)
3
-
description: How to use Azure IoT Hub device twins to add tags and then use an IoT Hub query to filter device twins. You use the Azure CLI to create and simulate a device on your IoT hub, add tags to its corresponding device twin, and then run IoT Hub queries to filter the device twins on your IoT hub.
3
+
description: How to use Azure IoT Hub device twins and the Azure CLI to create and simulate devices, add tags to device twins, and execute IoT Hub queries.
4
4
author: kgremban
5
5
6
6
ms.service: iot-hub
@@ -24,9 +24,9 @@ This article shows you how to:
24
24
25
25
This article shows you how to create two Azure CLI sessions:
26
26
27
-
* A session that creates a simulated device. The simulated device is configured to report its connectivity channel as a reported property on the device's corresponding device twin when initialized.
27
+
* A session that creates a simulated device. The simulated device reports its connectivity channel as a reported property on the device's corresponding device twin when initialized.
28
28
29
-
* A session that updates the tags of the device twin for the simulated device, then queries devices from your IoT hub using filters on the tags and properties previously updated in both sessions.
29
+
* A session that updates the tags of the device twin for the simulated device, then queries devices from your IoT hub. The queries use filters based on the tags and properties previously updated in both sessions.
30
30
31
31
## Prerequisites
32
32
@@ -91,7 +91,7 @@ To create and start a simulated device:
91
91
az iot hub device-identity create --device-id {DeviceName} --hub-name {HubName}
92
92
```
93
93
94
-
1. In the first CLI session, run the [az iot device simulate](/cli/azure/iot/device#az-iot-device-simulate) command, replacing the following placeholders with their corresponding values. This command simulates the device you created in the previous step. The simulated device is configured to report its connectivity channel as a reported property on the device's corresponding device twin when initialized.
94
+
1. In the first CLI session, run the [az iot device simulate](/cli/azure/iot/device#az-iot-device-simulate) command, replacing the following placeholders with their corresponding values. This command simulates the device you created in the previous step. The command also configures the simulated device to report its connectivity channel as a reported property on the device's corresponding device twin when initialized.
95
95
96
96
*{DeviceName}*. The name of your simulated device.
97
97
@@ -107,7 +107,7 @@ To create and start a simulated device:
107
107
108
108
## Update the device twin
109
109
110
-
Once a device identity is created, a device twin is implicitly created in IoT Hub. In this section, you use the second CLI session to update a set of tags on the device twin associated with the device identity you created in the previous section.
110
+
Once a device identity is created, a device twin is implicitly created in IoT Hub. In this section, you use the second CLI session to update a set of tags on the device twin associated with the device identity you created in the previous section. You can use device twin tags to organize and manage devices in your IoT solutions. For more information about managing devices using tags, see [How to manage devices using device twin tags in Azure IoT Hub](iot-hubs-manage-device-twin-tags.md).
111
111
112
112
1. Confirm that the simulated device in the first CLI session is running. If not, restart it by running the [az iot device simulate](/cli/azure/iot/device#az-iot-device-simulate) command again from [Create and simulate a device](#create-and-simulate-a-device).
113
113
@@ -180,9 +180,9 @@ Once a device identity is created, a device twin is implicitly created in IoT Hu
180
180
}
181
181
```
182
182
183
-
## Query your IoT hub for devices
183
+
## Query your IoT hub for device twins
184
184
185
-
IoT Hub exposes the device twins for your IoT hub as a document collection called **devices**. In this section, you use the second CLI session to execute two queries on the set of device twins for your IoT hub: the first query selects only the device twins of devices located in the **Redmond43** plant, and the second refines the query to select only the devices that are also connected through a cellular network. Both queries are configured to return only the first 100 devices in the result set.
185
+
IoT Hub exposes the device twins for your IoT hub as a document collection called **devices**. In this section, you use the second CLI session to execute two queries on the set of device twins for your IoT hub: the first query selects only the device twins of devices located in the **Redmond43** plant, and the second refines the query to select only the devices that are also connected through a cellular network. Both queries return only the first 100 devices in the result set. For more information about device twin queries, see [Queries for IoT Hub device and module twins](query_twins.md).
186
186
187
187
1. Confirm that the simulated device in the first CLI session is running. If not, restart it by running the [az iot device simulate](/cli/azure/iot/device#az-iot-device-simulate) command again from [Create and simulate a device](#create-and-simulate-a-device).
Copy file name to clipboardExpand all lines: includes/iot-hub-selector-twin-get-started.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,17 +26,17 @@ Use device twins to:
26
26
27
27
* Query your device metadata, configuration, or state.
28
28
29
-
Device twins are designed for synchronization and for querying device configurations and conditions. More information on when to use device twins can be found in[Understand device twins](../articles/iot-hub/iot-hub-devguide-device-twins.md).
29
+
Device twins are designed for synchronization and for querying device configurations and conditions. For more information about device twins, including when to use device twins, see[Understand device twins](../articles/iot-hub/iot-hub-devguide-device-twins.md).
30
30
31
-
Device twins are stored in an IoT hub and contain the following elements:
31
+
IoT hubs store device twins, which contain the following elements:
32
32
33
33
***Tags**. Device metadata accessible only by the solution back end.
34
34
35
35
***Desired properties**. JSON objects modifiable by the solution back end and observable by the device app.
36
36
37
37
***Reported properties**. JSON objects modifiable by the device app and readable by the solution back end.
38
38
39
-
Tags and properties cannot contain arrays, but objects can be nested.
39
+
Tags and properties can't contain arrays, but can contain nested objects.
40
40
41
41
The following illustration shows device twin organization:
0 commit comments