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/how-to-device-twins.md
+15-18Lines changed: 15 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,17 +52,14 @@ For more information about device twins, see [Understand device twins](iot-hub-d
52
52
53
53
This article shows you how to:
54
54
55
-
* Retrieve a device twin and update it's properties
55
+
* Retrieve a device twin and update reported properties
56
56
* Update device twin tags
57
-
* Query device twin information, using SQL-like IoT Hub query language
58
-
* Use a backend application to add tags and query device twins.
59
-
* Report a device twin connectivity channel condition reported property.
60
-
* Query devices from your back-end app using filters on the tags and properties previously created.
61
-
62
-
This article is meant to complement runnable SDK samples that are referenced from within this article.
57
+
* Create a device desired property update notificaiton callback
58
+
* Use a backend application to update tags and desired properties
59
+
* Query devices from your back-end app using filters on the tags and properties previously created
63
60
64
61
> [!NOTE]
65
-
> See [Azure IoT SDKs](iot-hub-devguide-sdks.md)for more information about the SDK tools available to build both device and back-end apps.
62
+
> This article is meant to complement compilable [Azure IoT SDKs](iot-hub-devguide-sdks.md)samples that are referenced from within this article. You can use SDK tools to build both device and back-end apps.
66
63
67
64
## Prerequisites
68
65
@@ -72,25 +69,25 @@ This article is meant to complement runnable SDK samples that are referenced fro
72
69
73
70
* Make sure that port 8883 is open in your firewall. The device sample in this article uses MQTT protocol, which communicates over port 8883. This port may be blocked in some corporate and educational network environments. For more information and ways to work around this issue, see [Connecting to IoT Hub (MQTT)](../iot/iot-mqtt-connect-to-iot-hub.md#connecting-to-iot-hub).
74
71
75
-
## Get the IoT Hub service connection string
72
+
* IoT Hub service connection string
76
73
77
-
In this article, you create a back-end service that adds desired properties to a device twin and then queries the identity registry to find all devices with reported properties that have been updated accordingly. Your service needs the **service connect** permission to modify desired properties of a device twin, and it needs the **registry read** permission to query the identity registry. There is no default shared access policy that contains only these two permissions, so you need to create one.
74
+
In this article, you create a back-end service that adds desired properties to a device twin and then queries the identity registry to find all devices with reported properties that have been updated accordingly. Your service needs the **service connect** permission to modify desired properties of a device twin, and it needs the **registry read** permission to query the identity registry. There is no default shared access policy that contains only these two permissions, so you need to create one.
78
75
79
-
To create a shared access policy that grants **service connect** and **registry read** permissions and get a connection string for this policy, follow these steps:
76
+
To create a shared access policy that grants **service connect** and **registry read** permissions and get a connection string for this policy, follow these steps:
80
77
81
-
1. In the Azure portal, select **Resource groups**. Select the resource group where your hub is located, and then select your hub from the list of resources.
78
+
1. In the Azure portal, select **Resource groups**. Select the resource group where your hub is located, and then select your hub from the list of resources.
82
79
83
-
1. On the left-side pane of your hub, select **Shared access policies**.
80
+
1. On the left-side pane of your hub, select **Shared access policies**.
84
81
85
-
1. From the top menu above the list of policies, select **Add shared policy access policy**.
82
+
1. From the top menu above the list of policies, select **Add shared policy access policy**.
86
83
87
-
1. In the **Add shared access policy** pane on the right, enter a descriptive name for your policy, such as "serviceAndRegistryRead". Under **Permissions**, select **Registry Read** and **Service Connect**, and then select **Add**.
84
+
1. In the **Add shared access policy** pane on the right, enter a descriptive name for your policy, such as "serviceAndRegistryRead". Under **Permissions**, select **Registry Read** and **Service Connect**, and then select **Add**.
88
85
89
-
1. Select your new policy from the list of policies.
86
+
1. Select your new policy from the list of policies.
90
87
91
-
1. Select the copy icon for the **Primary connection string** and save the value.
88
+
1. Select the copy icon for the **Primary connection string** and save the value.
92
89
93
-
For more information about IoT Hub shared access policies and permissions, see [Access control and permissions](/azure/iot-hub/authenticate-authorize-sas).
90
+
For more information about IoT Hub shared access policies and permissions, see [Access control and permissions](/azure/iot-hub/authenticate-authorize-sas).
0 commit comments