This folder contains simple samples showing how to use the various features of Microsoft Azure IoT Hub service, from a device running C# code.
- Reconnection sample
- This sample illustrates how to write a device application to handle connection issues, connection-related exceptions, and how to manage the lifetime of the
DeviceClient
- Includes sending messages and symmetric key failover
- This sample illustrates how to write a device application to handle connection issues, connection-related exceptions, and how to manage the lifetime of the
- Method sample
- Receive message sample
- Twin sample
- File upload sample
- Connect with X.509 certificate sample
- Plug and Play samples sample
- Xamarin sample
- Simulated device sample
- Hub routing sample sample
- Simulated device with command sample
In order to run the device samples on Linux or Windows, you will first need the following prerequisites:
The following prerequisite is the minimum requirement to build and run the samples.
- Install the latest .NET Core from https://dot.net
Visual Studio is not required to run the samples.
You need to clone the repository or download the sample (the one you want to try) project's folder on your device.
-
Building the sample application
To build the sample application using dotnet, from terminal navigate to the sample folder (where the .csproj file lives). Then execute the following command and check for build errors:
dotnet build
-
Preparing the sample application:
-
Many of these samples take parameters. To see the parameters required, type:
dotnet run --help
-
-
Running the sample application:
To run the sample application using dotnet, execute the following command with any required parameters discovered in the previous step.
dotnet run