Skip to content

Files

samples

This folder contains simple samples showing how to use the various features of Microsoft Azure IoT Hub service, from a device running C# code.

Device samples

Prerequisites

In order to run the device samples on Linux or Windows, you will first need the following prerequisites:

Setup environment

The following prerequisite is the minimum requirement to build and run the samples.

Visual Studio is not required to run the samples.

Get and 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.

Build and run the samples

  1. 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
  2. Preparing the sample application:

    1. Many of these samples take parameters. To see the parameters required, type:

      dotnet run --help
  3. 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