Closed feckert closed 2 years ago
Hi, thanks for your question about this.
Yes, in general, a Property is intended for device (or digital twin) state. In particular, for devices that are connected to IoT Hub, a Property is used to synchronize state between the device and IoT Hub. For example, a cloud service can update a writable Property and, when a device connects to IoT Hub, it can get the latest updates (desired property values) from the cloud.
You're also correct that currently arrays are not supported for Properties. This is a limitation we are working on correcting.
In the meantime, there are a couple approaches that you can take and still get the benefits of Properties:
I am currently writing a dtdl for my device. This is a network device. I want to create rules for the firewall via the IoT-Hub. I wanted to use the properties for this. Somehow I can't find a sample that explains it properly! All properties are defined at the top level, after the "contents". I also saw that apparently the property type does not support arrays in schema! Now, unfortunately, it is not clear to me how I should map this.
I would have imagined it like this (this is not a valid dtdl description):
I want to create a firewall rule, for example, via a command, and then edit this via the property. The question I have is whether the property is intended for this purpose at all or should I also use the command to create it with the values, but then I can no longer change the properties afterwards. The configurations are saved on the unit.
Maybe you can help me further. I am at a bit of a loss as to how to implement this now?