Reputation: 33
Is it possible to update Azure IoT Edge Desired Properties Update From Azure Module.
Here is what i want to do :
Let us say i have below json in deployment manifest of my IoT Edge Device
"$edgeHub": {
"properties.desired": {
"schemaVersion": "1.0",
"routes": {
"sensorToFilter": "FROM /messages/modules/SimulatedTemperatureSensor/outputs/temperatureOutput INTO BrokeredEndpoint(\"/modules/filtermodule/inputs/input1\")",
"filterToIoTHub": "FROM /messages/modules/filtermodule/outputs/output1 INTO $upstream"
},
"storeAndForwardConfiguration": {
"timeToLiveSecs": 10,
"lastSyncDt" : "2019-08-19 17:06:33:323"
}
}
}
Question is, is it possible to update "lastSyncDt" to new datetime value from iot edge module during runtime.
Thanks in advance.
Upvotes: 1
Views: 1647
Reputation: 702
Yes, you should be able to update everything you need using the SDK.
Here is a link to the .NET SDK for the device client:
https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-csharp-csharp-twin-getstarted#create-the-device-app
I've pointed out the specific part of the device part of the document.
But, keep in mind, the idea of the device twin is a bit different.
If someone wants to update the device twin from the outside, you update the desired property.
The device listens to changes on these properties, do some work and updates the reported properties.
The IoT hub can emit these events and let you listen to reported properties changes so you can react to them.
The classic example is the device firmware version:
Upvotes: 1