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
> [Module identities and module twins](iot-hub-devguide-module-twins.md) are similar to Azure IoT Hub device identity and device twin, but provide finer granularity. While Azure IoT Hub device identity and device twin enable the back-end application to configure a device and provides visibility on the device's conditions, a module identity and module twin provide these capabilities for individual components of a device. On capable devices with multiple components, such as operating system based devices or firmware devices, it allows for isolated configuration and conditions for each component.
18
+
[Module identities and module twins](iot-hub-devguide-module-twins.md) are similar to Azure IoT Hub device identity and device twin, but provide finer granularity. While Azure IoT Hub device identity and device twin enable the back-end application to configure a device and provides visibility on the device's conditions, a module identity and module twin provide these capabilities for individual components of a device. On capable devices with multiple components, such as operating system devices or firmware devices, it allows for isolated configuration and conditions for each component.
20
19
21
20
At the end of this article, you have two C apps:
22
21
23
-
***CreateIdentities**, which creates a device identity, a module identity and associated security key to connect your device and module clients.
22
+
***CreateIdentities**: creates a device identity, a module identity and associated security key to connect your device and module clients.
24
23
25
-
***UpdateModuleTwinReportedProperties**, which sends updated module twin reported properties to your IoT Hub.
24
+
***UpdateModuleTwinReportedProperties**: sends updated module twin, reported properties to your IoT Hub.
26
25
27
26
> [!NOTE]
28
-
> For information about the Azure IoT SDKs that you can use to build both applications to run on devices, and your solution backend, see [Azure IoT SDKs](iot-hub-devguide-sdks.md).
27
+
> 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.
29
28
30
29
## Prerequisites
31
30
32
-
* An active Azure account. (If you don't have an account, you can create an [Azure free account](https://azure.microsoft.com/pricing/free-trial/) in just a couple of minutes.)
33
-
34
31
* An IoT Hub. Create one with the [CLI](iot-hub-create-using-cli.md) or the [Azure portal](iot-hub-create-through-portal.md).
35
32
36
33
* The latest [Azure IoT C SDK](https://github.com/Azure/azure-iot-sdk-c).
@@ -43,7 +40,7 @@ At the end of this article, you have two C apps:
43
40
44
41
## Create a device identity and a module identity in IoT Hub
45
42
46
-
In this section, you create a C app that creates a device identity and a module identity in the identity registry in your IoT hub. A device or module cannot connect to IoT hub unless it has an entry in the identity registry. For more information, see the **Identity registry** section of the [IoT Hub developer guide](iot-hub-devguide-identity-registry.md). When you run this console app, it generates a unique ID and key for both device and module. Your device and module use these values to identify itself when it sends device-to-cloud messages to IoT Hub. The IDs are case-sensitive.
43
+
In this section, you create a C app that creates a device identity and a module identity in the identity registry in your IoT hub. A device or module can't connect to IoT hub unless it has an entry in the identity registry. For more information, see [Understand the identity registry in your IoT hub](iot-hub-devguide-identity-registry.md). When you run this console app, it generates a unique ID and key for both device and module. Your device and module use these values to identify itself when it sends device-to-cloud messages to IoT Hub. The IDs are case-sensitive.
47
44
48
45
Add the following code to your C file:
49
46
@@ -180,7 +177,7 @@ This app creates a device identity with ID **myFirstDevice** and a module identi
180
177
181
178
In this section, you create a C app on your simulated device that updates the module twin reported properties.
182
179
183
-
1. **Get your module connection string** -- now if you login to [Azure portal](https://portal.azure.com). Navigate to your IoT Hub and click IoT Devices. Find myFirstDevice, open it and you see myFirstModule was successfully created. Copy the module connection string. It is needed in the next step.
180
+
1. **Get your module connection string** -- now if you sign in to [Azure portal](https://portal.azure.com). Navigate to your IoT Hub and click IoT Devices. Find myFirstDevice, open it and you see myFirstModule was successfully created. Copy the module connection string. It is needed in the next step.
> [Module identities and module twins](iot-hub-devguide-module-twins.md) are similar to Azure IoT Hub device identity and device twin, but provide finer granularity. While Azure IoT Hub device identity and device twin enable the back-end application to configure a device and provide visibility on the device's conditions, a module identity and module twin provide these capabilities for individual components of a device. On capable devices with multiple components, such as operating system based devices or firmware devices, module identities and module twins allow for isolated configuration and conditions for each component.
18
+
[Module identities and module twins](iot-hub-devguide-module-twins.md) are similar to Azure IoT Hub device identity and device twin, but provide finer granularity. While Azure IoT Hub device identity and device twin enable the back-end application to configure a device and provide visibility on the device's conditions, a module identity and module twin provide these capabilities for individual components of a device. On capable devices with multiple components, such as operating system devices or firmware devices, module identities and module twins allow for isolated configuration and conditions for each component.
20
19
21
20
At the end of this article, you have two .NET console apps:
22
21
23
-
***CreateIdentities**. This app creates a device identity, a module identity, and associated security key to connect your device and module clients.
22
+
***CreateIdentities**: creates a device identity, a module identity, and associated security key to connect your device and module clients.
24
23
25
-
***UpdateModuleTwinReportedProperties**. This app sends updated module twin reported properties to your IoT hub.
24
+
***UpdateModuleTwinReportedProperties**: sends updated module twin, reported properties to your IoT hub.
26
25
27
26
> [!NOTE]
28
-
> For information about the Azure IoT SDKs that you can use to build both applications to run on devices, and your solution backend, see [Azure IoT SDKs](iot-hub-devguide-sdks.md).
27
+
> 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.
29
28
30
29
## Prerequisites
31
30
32
31
* Visual Studio.
33
32
34
-
* An active Azure account. If you don't have an account, you can create a [free account](https://azure.microsoft.com/pricing/free-trial/) in just a couple of minutes.
35
-
36
33
* An IoT Hub. Create one with the [CLI](iot-hub-create-using-cli.md) or the [Azure portal](iot-hub-create-through-portal.md).
37
34
38
35
## Get the IoT hub connection string
@@ -45,9 +42,9 @@ At the end of this article, you have two .NET console apps:
45
42
46
43
## Update the module twin using .NET device SDK
47
44
48
-
In this section, you create a .NET console app on your simulated device that updates the module twin reported properties.
45
+
Now let's communicate to the cloud from your simulated device. Once a module identity is created, a module twin is implicitly created in IoT Hub. In this section, you create a .NET console app on your simulated device that updates the module twin reported properties.
49
46
50
-
Here's how to get your module connection string from the Azure portal. Sign in to the [Azure portal](https://portal.azure.com/). Navigate to your hub and select **Devices**. Find **myFirstDevice**. Select**myFirstDevice** to open it, and then select **myFirstModule** to open it. In **Module Identity Details**, copy the **Connection string (primary key)**to save it for the console app.
47
+
To retrieve your module connection string, navigate to your [IoT hub](https://ms.portal.azure.com/#view/HubsExtension/BrowseResource/resourceType/Microsoft.Devices%2FIotHubs) then select **Devices**. Find and select**myFirstDevice** to open it and then select **myFirstModule** to open it. In **Module Identity Details**, copy the **Connection string (primary key)**and save it for the console app.
51
48
52
49
:::image type="content" source="./media/iot-hub-csharp-csharp-module-twin-getstarted/module-identity-detail.png" alt-text="Screenshot that shows the 'Module Identity Details' page." lightbox="./media/iot-hub-csharp-csharp-module-twin-getstarted/module-identity-detail.png":::
53
50
@@ -143,7 +140,7 @@ Here's how to get your module connection string from the Azure portal. Sign in t
> [Module identities and module twins](iot-hub-devguide-module-twins.md) are similar to Azure IoT Hub device identity and device twin, but provide finer granularity. While Azure IoT Hub device identity and device twin enable the back-end application to configure a device and provides visibility on the device's conditions, a module identity and module twin provide these capabilities for individual components of a device. On capable devices with multiple components, such as operating system-based devices or firmware devices, it allows for isolated configuration and conditions for each component.
18
+
[Module identities and module twins](iot-hub-devguide-module-twins.md) are similar to Azure IoT Hub device identity and device twin, but provide finer granularity. While Azure IoT Hub device identity and device twin enable the back-end application to configure a device and provides visibility on the device's conditions, a module identity and module twin provide these capabilities for individual components of a device. On capable devices with multiple components, such as operating system devices or firmware devices, it allows for isolated configuration and conditions for each component.
20
19
21
20
At the end of this article, you have two Node.js apps:
22
21
23
-
***CreateIdentities**, which creates a device identity, a module identity, and associated security keys to connect your device and module clients.
22
+
***CreateIdentities**: creates a device identity, a module identity, and associated security keys to connect your device and module clients.
24
23
25
-
***UpdateModuleTwinReportedProperties**, which sends updated module twin reported properties to your IoT Hub.
24
+
***UpdateModuleTwinReportedProperties**: sends updated module twin, reported properties to your IoT Hub.
26
25
27
26
> [!NOTE]
28
-
> For information about the Azure IoT SDKs that you can use to build both applications to run on devices, and your solution backend, see [Azure IoT SDKs](iot-hub-devguide-sdks.md).
27
+
> 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.
29
28
30
29
## Prerequisites
31
30
32
31
* An IoT Hub. Create one with the [CLI](iot-hub-create-using-cli.md) or the [Azure portal](iot-hub-create-through-portal.md).
33
32
34
33
* Node.js version 10.0.x or later. [Prepare your development environment](https://github.com/Azure/azure-iot-sdk-node/tree/main/doc/node-devbox-setup.md) describes how to install Node.js for this article on either Windows or Linux.
35
34
36
-
* An active Azure account. (If you don't have an account, you can create a [free account](https://azure.microsoft.com/pricing/free-trial/) in just a couple of minutes.)
@@ -43,7 +40,7 @@ At the end of this article, you have two Node.js apps:
43
40
44
41
## Create a device identity and a module identity in IoT Hub
45
42
46
-
In this section, you create a Node.js app that creates a device identity and a module identity in the identity registry in your IoT hub. A device or module cannot connect to IoT hub unless it has an entry in the identity registry. For more information, see the "Identity registry" section of the [IoT Hub developer guide](iot-hub-devguide-identity-registry.md). When you run this console app, it generates a unique ID and key for both device and module. Your device and module use these values to identify itself when it sends device-to-cloud messages to IoT Hub. The IDs are case-sensitive.
43
+
In this section, you create a Node.js app that creates a device identity and a module identity in the identity registry in your IoT hub. A device or module can't connect to IoT hub unless it has an entry in the identity registry. For more information, see [Understand the identity registry in your IoT hub](iot-hub-devguide-identity-registry.md). When you run this console app, it generates a unique ID and key for both device and module. The ID and key are case-sensitive. Your device and module use these values to identify itself when it sends device-to-cloud messages to IoT Hub.
> [Module identities and module twins](iot-hub-devguide-module-twins.md) are similar to Azure IoT Hub device identity and device twin, but provide finer granularity. While Azure IoT Hub device identity and device twin enable the back-end application to configure a device and provide visibility on the device's conditions, a module identity and module twin provide these capabilities for individual components of a device. On capable devices with multiple components, such as operating system based devices or firmware devices, module identities and module twins allow for isolated configuration and conditions for each component.
20
-
>
18
+
[Module identities and module twins](iot-hub-devguide-module-twins.md) are similar to Azure IoT Hub device identity and device twin, but provide finer granularity. While Azure IoT Hub device identity and device twin enable the back-end application to configure a device and provide visibility on the device's conditions, a module identity and module twin provide these capabilities for individual components of a device. On capable devices with multiple components, such as operating system devices or firmware devices, module identities and module twins allow for isolated configuration and conditions for each component.
21
19
22
-
In this article, you will learn:
20
+
In this article, you will learn how to:
23
21
24
-
*How to create a module identity in the portal.
22
+
*Create a module identity in the portal.
25
23
26
-
*How to use a .NET device SDK to update the module twin from your device.
24
+
*Use a .NET device SDK to update the module twin from your device.
27
25
28
26
> [!NOTE]
29
-
> For information about the Azure IoT SDKs that you can use to build both applications to run on devices and your solution back end, see [Azure IoT SDKs](iot-hub-devguide-sdks.md).
30
-
>
27
+
> 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.
31
28
32
29
## Prerequisites
33
30
34
31
* Visual Studio.
35
32
36
-
* An active Azure account. If you don't have an account, you can create a [free account](https://azure.microsoft.com/pricing/free-trial/) in just a couple of minutes.
37
-
38
33
* An IoT Hub. Create one with the [CLI](iot-hub-create-using-cli.md) or the [Azure portal](iot-hub-create-through-portal.md).
39
34
40
35
* A registered device. Register one in the [Azure portal](iot-hub-create-through-portal.md#register-a-new-device-in-the-iot-hub).
@@ -57,11 +52,11 @@ Save the **Connection string (primary key)**. You use it in the next section to
57
52
58
53
## Update the module twin using .NET device SDK
59
54
60
-
You've successfully created the module identity in your IoT Hub. Let's try to communicate to the cloud from your simulated device. Once a module identity is created, a module twin is implicitly created in IoT Hub. In this section, you will create a .NET console app on your simulated device that updates the module twin reported properties.
55
+
Now let's communicate to the cloud from your simulated device. Once a module identity is created, a module twin is implicitly created in IoT Hub. In this section, you will create a .NET console app on your simulated device that updates the module twin reported properties.
61
56
62
57
### Create a Visual Studio project
63
58
64
-
To create an app that updates the module twin reported properties, follow these steps:
59
+
To create an app that updates the module twin, reported properties, follow these steps:
65
60
66
61
1. In Visual Studio, select **Create a new project**, then choose **Console App (.NET Framework)**, and select **Next**.
67
62
@@ -73,13 +68,13 @@ To create an app that updates the module twin reported properties, follow these
73
68
74
69
### Install the latest Azure IoT Hub .NET device SDK
75
70
76
-
Module identity and module twin is in public preview. It's only available in the IoT Hub pre-release device SDKs. To install it, follow these steps:
71
+
Module identity and module twin is only available in the IoT Hub pre-release device SDKs. To install it, follow these steps:
77
72
78
73
1. In Visual Studio, open **Tools** > **NuGet Package Manager** > **Manage NuGet Packages for Solution**.
79
74
80
75
1. Select **Browse**, and then select **Include prerelease**. Search for *Microsoft.Azure.Devices.Client*. Select the latest version and install.
81
76
82
-
:::image type="content" source="./media/iot-hub-csharp-csharp-module-twin-getstarted/install-client-sdk.png" alt-text="Screenshot showing how to install the Microsoft.Azure.Devices.Client.":::
77
+
:::image type="content" source="./media/iot-hub-csharp-csharp-module-twin-getstarted/install-client-sdk.png" alt-text="Screenshot showing how to install the Microsoft.Azure.Devices.Client." lightbox="./media/iot-hub-csharp-csharp-module-twin-getstarted/install-client-sdk.png":::
83
78
84
79
Now you have access to all the module features.
85
80
@@ -162,12 +157,12 @@ To create your app, follow these steps:
162
157
163
158
You can build and run this app by using **F5**.
164
159
165
-
This code sample shows you how to retrieve the module twin and update reported properties with AMQP protocol. In public preview, we only support AMQP for module twin operations.
160
+
Now you know how to retrieve the module twin and update reported properties with AMQP protocol.
166
161
167
162
## Next steps
168
163
169
164
To continue getting started with IoT Hub and to explore other IoT scenarios, see:
170
165
171
-
*[Get started with IoT Hub module identity and module twin using .NET backup and .NET device](iot-hub-csharp-csharp-module-twin-getstarted.md)
166
+
*[Getting started with device management](iot-hub-node-node-device-management-get-started.md)
172
167
173
168
*[Getting started with IoT Edge](../iot-edge/quickstart-linux.md)
0 commit comments