Azure IOT Hub - Configure your devices from a back-end service Tutorial C# Example MISSING

OJB1 31 Reputation points
2021-04-18T20:48:35.7+00:00

I'm trying to work my way through the Azure IOT Hubs documentation and have come to a grinding halt as the tutorial for "Configure your devices from a back-end service" does not provide a solution for .NET, they only provide a tutorial that requires using Node.Js for the simulated devices.

Can someone please advise where I get a C# equivalent guide to the above?

The tutorial in question is here: https://learn.microsoft.com/en-us/azure/iot-hub/tutorial-device-twins

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
693 questions
Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
253 questions
Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
163 questions
No comments
{count} votes

Accepted answer
  1. Sander van de Velde 15,226 Reputation points Microsoft MVP
    2021-04-19T19:21:23.597+00:00

    Hello @OJB1 ,

    it seems you want to explore Cloud-To-Device (C2D) communication.

    Azure IoT supports both D2C and C2D communication out-of-the-box with the Device SDKs for different development languages.

    If you are interested in C#, check out this blog post.

    There you found examples of both Desired properties and Direct methods, two popular but different ways to communicate.

    Desired properties are values set in the Device Twin, a document in the IoT Hub where devices check for changes if they connect to the cloud. So this is great for not-always-connected devices.

    The Direct Method needs a live connection. The advantage is that you can expect an actual answer from the device or a time-out.

    It also demonstrated commands. These are 'function calls' like direct methods but the device can pick them up later if they are not connected yet. Hence, no result is returned.

    If you are interested in more training, please check out the MS Learn IoT-related modules and learning paths.

    No comments

1 additional answer

Sort by: Most helpful
  1. OJB1 31 Reputation points
    2021-04-19T21:43:52.407+00:00

    Hi SandervandeVelde42,

    Thank you for your reply, I will read your article with great interest.

    I have successfully set the desired properties for a device twin from the service side, but what I'm really after is example code in how to read those desired properties from the IOT Device end.

    Hopefully your article covers this but if not, would you have nay other suggestions?

    I don't understand why Microsoft do not provide a C# example in their documentation, is there any logical reason for this? many thanks