End-to-end .NET IoT and Azure IoT Hub example
This sample console application provides an example that combines learnings from the following two Microsoft Learn modules:
- Construct Internet of Things devices using the .NET IoT Libraries
- Remotely monitor and control devices with Azure IoT Hub
Important
It is strongly recommended that you complete the two list Microsoft Learn modules before using this sample.
Running the sample
- Provision an Azure IoT Hub resource and device as described in Exercise - Create an Azure IoT Hub, and a device ID, using the Microsoft Azure portal.
- In Program.cs, replace
YOUR DEVICE CONNECTION STRING HEREwith your device connection string from the previous step. - Construct a device as described in Exercise: Construct IoT hardware.
- Deploy the app to your device as described in Exercise: Deploy app to Raspberry Pi.
- Run the app as described in Exercise: Test the app
You will be able to interact with the device in the Azure portal using direct methods and device twins. The cheesecaveoperator back-end app is optional.

