Skip to content

Commit

Permalink
fix: samples readme links were out-of-date
Browse files Browse the repository at this point in the history
  • Loading branch information
David R. Williamson committed Feb 10, 2021
1 parent 3eaf88e commit 8e0fad3
Showing 1 changed file with 38 additions and 28 deletions.
66 changes: 38 additions & 28 deletions iothub/device/samples/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,73 @@
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][device-samples]
* [Message Sample][d-message-sample]
* [Method Sample][d-method-sample]
* [Twin Sample][d-twin-sample]
* [File Upload Sample][d-file-upload-sample]
* [Keys Rollover Sample][d-keys-rollover-sample]
* [Import Export Devices Sample][d-import-export-devices-sample]
* [Plug And Play Device Sample][d-pnp-sample]
* [Xamarin Sample][d-xamarin-sample]

- [Reconnection sample][d-message-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
- [Method sample][d-method-sample]
- [Receive message sample][d-receive-message-sample]
- [Twin sample][d-twin-sample]
- [File upload sample][d-file-upload-sample]
- [Import/export devices sample][d-import-export-devices-sample]
- [Connect with X509 certificate sample][d-x509-cert-sample]
- [Plug and Play device samples][d-pnp-sample]
- [Xamarin sample][d-xamarin-sample]

### [Module samples][module-samples]
* [Message Sample][m-message-sample]
* [Twin Sample][m-twin-sample]

- [Message sample][m-message-sample]
- [Twin sample][m-twin-sample]

### Prerequisites

In order to run the device samples on Linux or Windows, you will first need the following prerequisites:
* [Setup your IoT hub][lnk-setup-iot-hub]
* [Provision your device and get its credentials][lnk-manage-iot-device]

- [Setup your IoT hub][lnk-setup-iot-hub]
- [Provision your device and get its credentials][lnk-manage-iot-device]

### Setup environment

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

Visual Studio is **not required** to run the samples.
- Install the latest .NET Core from <https://dot.net>

- Install the latest .NET Core from https://dot.net
> 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:
#### Build and run the samples

1. Preparing the sample application:
1. Set the following environment variables on the terminal from which you want to run the application.

* IOTHUB_DEVICE_CONNECTION_STRING
- IOTHUB_DEVICE_CONNECTION_STRING

2. Building the sample application:
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:
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
```
```console
dotnet build
```

3. Running the sample application:
1. Running the sample application:

To run the sample application using dotnet, execute the following command.
To run the sample application using dotnet, execute the following command.

```
dotnet run
```
```console
dotnet run
```

[device-samples]: https://github.com/Azure-Samples/azure-iot-samples-csharp/tree/master/iot-hub/Samples/device
[d-message-sample]: https://github.com/Azure-Samples/azure-iot-samples-csharp/tree/master/iot-hub/Samples/device/MessageSample
[d-message-sample]: https://github.com/Azure-Samples/azure-iot-samples-csharp/tree/master/iot-hub/Samples/device/DeviceReconnectionSample
[d-receive-message-sample]: https://github.com/Azure-Samples/azure-iot-samples-csharp/tree/master/iot-hub/Samples/device/MessageReceiveSample
[d-method-sample]: https://github.com/Azure-Samples/azure-iot-samples-csharp/tree/master/iot-hub/Samples/device/MethodSample
[d-twin-sample]: https://github.com/Azure-Samples/azure-iot-samples-csharp/tree/master/iot-hub/Samples/device/TwinSample
[d-file-upload-sample]: https://github.com/Azure-Samples/azure-iot-samples-csharp/tree/master/iot-hub/Samples/device/FileUploadSample
[d-keys-rollover-sample]: https://github.com/Azure-Samples/azure-iot-samples-csharp/tree/master/iot-hub/Samples/device/KeysRolloverSample
[d-x509-cert-sample]: https://github.com/Azure-Samples/azure-iot-samples-csharp/tree/master/iot-hub/Samples/device/X509DeviceCertWithChainSample
[d-import-export-devices-sample]: https://github.com/Azure-Samples/azure-iot-samples-csharp/tree/master/iot-hub/Samples/device/ImportExportDevicesSample
[d-pnp-sample]: https://github.com/Azure-Samples/azure-iot-samples-csharp/tree/master/iot-hub/Samples/device/PnpDeviceSamples
[d-xamarin-sample]: https://github.com/Azure-Samples/azure-iot-samples-csharp/tree/master/iot-hub/Samples/device/XamarinSample
Expand Down

0 comments on commit 8e0fad3

Please sign in to comment.