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
Use the IoT Hub device and service SDKs to develop applications that handle common device twin tasks. Device twins are JSON documents that store device state information, including metadata, configurations, and conditions. IoT Hub persists a device twin for each device that connects to it.
18
+
Use the Azure IoT Hub device SDK and service SDK to develop applications that handle common device twin tasks. Device twins are JSON documents that store device state information including metadata, configurations, and conditions. IoT Hub persists a device twin for each device that connects to it. You can use device twins to:
* Store device metadata from your solution back end
25
-
26
-
* Report current state information such as available capabilities and conditions, for example, the connectivity method used, from your device app
27
-
28
-
* Synchronize the state of long-running workflows, such as firmware and configuration updates, between a device app and a back-end app
29
-
30
-
* Query your device metadata, configuration, or state
31
-
32
-
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](iot-hub-devguide-device-twins.md).
33
-
34
-
IoT Hubs store device twins, which contain the following elements:
20
+
* Store device metadata from your solution back end.
21
+
* Report current state information such as available capabilities and conditions, for example, the connectivity method used, from your device app.
22
+
* Synchronize the state of long-running workflows, such as firmware and configuration updates, between a device app and a back-end app.
23
+
* Query your device metadata, configuration, or state.
35
24
36
-
***Tags**. Device metadata accessible only by the solution back end.
25
+
For more information about device twins, including when to use device twins, see [Understand device twins](iot-hub-devguide-device-twins.md).
37
26
38
-
***Desired properties**. JSON objects modifiable by the solution back end and observable by the device app.
39
-
40
-
***Reported properties**. JSON objects modifiable by the device app and readable by the solution back end.
41
-
42
-
Tags and properties can't contain arrays, but can contain nested objects.
43
-
44
-
The following illustration shows device twin organization:
45
-
46
-
:::image type="content" source="../../includes/media/iot-hub-selector-twin-get-started/twin.png" alt-text="Screenshot of a device twin concept diagram.":::
47
-
48
-
It is useful to review the various device twin fields that are available using the Azure portal. To learn how, see [How to view and update devices based on device twin properties](/azure/iot-hub/manage-device-twins).
49
-
50
-
Additionally, the solution back end can query device twins based on all the above data. For more information about querying, see [IoT Hub query language](iot-hub-devguide-query-language.md).
* Create a device desired property update notificaton callback
57
-
* Use a backend application to update tags and desired properties
58
-
* Query devices from your back-end app using filters on the tags and properties previously created
29
+
This article shows you how to develop two types of applications. Device apps can handle requests to update desired properties and respond with changes to reported properties. Service apps can update device twin tags, set new desired properties, and query devices based on device twin values.
59
30
60
31
> [!NOTE]
61
32
> This article is meant to complement [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 applications.
0 commit comments