IoT Hub Module Twin Tag value disappears after re-provisioning via DPS

Abby Greentree 126 Reputation points
2023-02-17T22:44:28.4133333+00:00

I am using x509 certificates as Device Authentication Type with Azure Device Update Agent installed on my device. The device Update Agent uses a Module Identity with Symmetric Keys as the authentication type (this is done through Azure Identity Service).

When device certificates are periodically rotated, the device re-provisions itself via DPS to update the certificate thumbprint within IoT Hub. After this happens, it seems the Module Twin complete resets. If I had previously set a device's ADUGroup value in the tags of the Device Update Agent's Module Twin, it disappears after certificate refresh and the device loses it's group.

Any insights as to how I can avoid this issue and persist the ADU group across re-provisioning?

Thank you in advanced for your assistance.

Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
925 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,115 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. QuantumCache 20,031 Reputation points
    2023-02-18T02:38:28.82+00:00

    Hello Abby Greentree, This is a great discussion, thanks for bringing to this forum.

         To persist the ADU group across re-provisioning, you can add the ADUGroup tag to the **device twin instead of the module twin.** The device twin is not reset during re-provisioning, so the tag value will persist.
    

    You can add the tag to the device twin using the Azure portal, Azure CLI, or a sample .NET app.

    Manage device groups in Device Update for IoT Hub

    Device Update for IoT Hub allows deploying an update to a group of IoT devices. This step is optional when deploying updates to your managed devices. You can deploy updates to your devices using the default group that is created for you. Alternatively, you can assign a user-defined tag to your devices, and they'll be automatically grouped based on the tag and the device compatibility properties.

    Understand and use device twins in IoT Hub

    Device twins are JSON documents that store device state information including metadata, configurations, and conditions. Azure IoT Hub maintains a device twin for each device that you connect to IoT Hub.

    Please comment in the below section if you need further help in this matter.

    If this answers your query, do click Accept Answer and Yes for this answer as helpful. And, if you have any further query do let us know.