0

We're moving our Azure IoT Edge devices from manual provisioning to DPS with symmetric key. One of the modules deployed to our devices needs to manage the Device Twin - we have been using this for state properties that persist across updates to modules. To connect to the device twin, I've been creating a DeviceClient from connection string which is loaded as an environment variable on a per device basis. This is using the C SDK.

Now I want to request the device credentials during provisioning so that the symmetric key is the only secret pre installed on the device.

A number of posts suggest that this isn't possible with best practices, most succinctly: Access IoT Edge Device Twin from Edge Module when using X.509 Authentication

Is this still the case? If so, what is the intended use for the device twin on IoT Edge, if user modules aren't supposed to access it in a production setting?

ryayl
  • 41
  • 1
  • Did you consider using Module Twins? https://learn.microsoft.com/en-us/azure/iot-edge/iot-edge-modules?view=iotedge-2020-11#module-twins – asergaz Aug 24 '21 at 16:29
  • Yes, ended up having to re-engineer our whole system to use only the module twins, with the filesystem on the edge device used for config that needs to persist beyond module updates. To set those persistent items, we have to use direct methods rather than the desired properties of the module twin. They only show up in the twin as reported properties. – ryayl Aug 25 '21 at 17:49

1 Answers1

0

A number of posts suggest that this isn't possible with best practices, most succinctly: Access IoT Edge Device Twin from Edge Module when using X.509 Authentication. Is this still the case?

This is still the case. Modules accessing device twin information is not supported or recommended. There are other ways to achieve what is desired - like one you described in your comment.

what is the intended use for the device twin on IoT Edge, if user modules aren't supposed to access it in a production setting?

The use case for device twins in IoT Edge is ADM deployments.

You create a deployment manifest and then define which devices it applies to based on tags in the device twin.

Ref: Understand IoT Edge automatic deployments for single devices or at scale

asergaz
  • 996
  • 5
  • 17