Malav Vakharia Greetings & Welcome to Microsoft Q&A forum!
It is possible to synchronize desired properties based on reported properties using .NET SDK? (Scenario will get the reported properties first from the device and then need to synchronize both desired and reported properties.)
Yes, it is possible to synchronize desired properties based on reported properties using the .NET SDK in Azure IoT Hub. Azure IoT Hub uses device twins to synchronize property values between the device and the Azure IoT Hub application. Device property values use device twin reported properties.
I would suggest you, check Understand Azure IoT Hub device twins and Azure IoT Hub device twins SDK for .NET for more details.
These docs provides detailed information on device twins, including how to use them to synchronize desired and reported properties. It also includes code samples and step-by-step instructions on how to work with device twins.
Another question is in .NET SDK there is code to update reported properties right so does iotedge runtime automatically synchronize the twin or explicitly have to write code using SDK? In Azure IoT Edge, the IoT Edge runtime automatically synchronizes the module twin with the IoT Hub cloud twin. When a module updates its reported properties, the IoT Edge runtime automatically updates the module twin in the IoT Hub cloud twin. Similarly, when the IoT Hub cloud twin is updated with desired properties, the IoT Edge runtime automatically updates the module twin.
You can use the Azure IoT Hub Device SDK for .NET to update the reported properties of a module twin. When you update the reported properties using the SDK, the IoT Edge runtime automatically synchronizes the module twin with the IoT Hub cloud twin.
Please refer DeviceClient.UpdateReportedPropertiesAsync Method and Sample for more information.
Do let me know if that helps or have any further queries.