1
votes

There is some confusion between two aspects of Azure IoT-Hub. I see here that Azure Digital Twins (with DTDL) simplify device state management (reported, desired properties) when compared to Azure IoT-Hub Device Twins. However, I see here that they appear to be separate but linkable entities.

So the question: Can Azure Digital Twins (and DTDL) be seen/used as REPLACEMENTS for Azure IoT-Hub Device Twins. How? If not, why not, since having two separate Twins appears overly complex?

Note that we use the IoT-Edge and leverage its offline features of reported and desired properties in the Iot-Hub Device Twins.

Thanks!

1

1 Answers

1
votes

Short answer: No

Longer and arguably more friendly answer: To leverage the Device Twins in IoT Hub, you need Device Twins in IoT Hub, but you can link it to your Digital Twin in Azure Digital Twins (ADT). If you want to include your Device Twin properties in ADT, you need to route your Device Twin messages to a Function that will make the translation to ADT. In this subsection of the docs, you can see the differences in notation.

If you want to let ADT 'drive' your Device Twin, you need to subscribe to ADT change notifications, consume them in another Function and apply the changes in the Device Twin in IoT Hub. This is currently all custom work, you can base some of the work on the link you provided in your question.

With regards to your question about complexity: it might seem a little complex to set up ADT as your single source of configuration, but when it's done, you have your config in one place. In practice, I'm not seeing this happen a lot.

Important to note

To make things a little more confusing, the first link you provided mentioned Digital Twins and Device Twins as if they're two different things, while in fact, it's three. You have the Device Twin in IoT Hub, the Digital Twin in IoT Plug and Play context and a Digital Twin within Azure Digital Twins. It's important to understand the differences between the three, as ADT is a separate system, but PnP Digital Twins and Device Twins are accessible through your IoT Hub.