You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-hub/tutorial-routing.md
+16-13Lines changed: 16 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ In this tutorial, you perform the following tasks:
39
39
40
40
* Make sure that port 8883 is open in your firewall. The sample in this tutorial uses MQTT protocol, which communicates over port 8883. This port may be blocked in some corporate and educational network environments. For more information and ways to work around this issue, see [Connecting to IoT Hub (MQTT)](iot-hub-mqtt-support.md#connecting-to-iot-hub).
41
41
42
-
* Optionally, install [Azure IoT Explorer](https://github.com/Azure/azure-iot-explorer). This tool helps you observe the messages as they arrive at your IoT hub.
42
+
* Optionally, install [Azure IoT Explorer](https://github.com/Azure/azure-iot-explorer). This tool helps you observe the messages as they arrive at your IoT hub. This article uses Azure IoT Explorer.
43
43
44
44
# [Azure portal](#tab/portal)
45
45
@@ -112,15 +112,14 @@ Now that you have a device ID and key, use the sample code to start sending devi
112
112
dotnet restore
113
113
```
114
114
115
-
1. In an editor of your choice, open the `Paramaters.cs` file. This file shows the parameters that are supported by the sample. Only the first three required parameters will be used in this article when running the sample. Review the code in this file. No changes are needed.
115
+
1. In an editor of your choice, open the `Parameters.cs` file. This file shows the parameters that are supported by the sample. Only the `PrimaryConnectionString` parameter will be used in this article when running the sample. Review the code in this file. No changes are needed.
116
+
116
117
1. Build and run the sample code using the following command:
117
118
118
-
* Replace `<myDeviceId>` with the device ID that you assigned when registering the device.
119
-
* Replace `<iotHubUri>` with the hostname of your IoT hub, which takes the format `IOTHUB_NAME.azure-devices.net`.
120
-
* Replace `<deviceKey>` with the device key that you copied from the device identity information.
119
+
Replace `<myDevicePrimaryConnectionString>` with your primary connection string from your device in your IoT hub.
121
120
122
121
```cmd
123
-
dotnet run --d <myDeviceId> --u <iotHubUri> --k <deviceKey>
122
+
dotnet run --PrimaryConnectionString <myDevicePrimaryConnectionString>
124
123
```
125
124
126
125
1. You should start to see messages printed to output as they are sent to IoT Hub. Leave this program running for the duration of the tutorial.
@@ -166,15 +165,15 @@ Now, use that connection string to configure IoT Explorer for your IoT hub.
166
165
1. Select **Save**.
167
166
1. Once you connect to your IoT hub, you should see a list of devices. Select the device ID that you created for this tutorial.
168
167
1. Select **Telemetry**.
169
-
1.Select **Start**.
168
+
1.With your device still running, select **Start**. If you're device is not running you won't see telemetry.
170
169
171
170

172
171
173
172
1. You should see the messages arriving from your device, with the most recent displayed at the top.
174
173
175
174

176
175
177
-
Watch the incoming messages for a few moments to verify that you see three different types of messages: normal, storage, and critical.
176
+
Watch the incoming messages for a few moments to verify that you see three different types of messages: normal, storage, and critical. After seeing this, you can stop your device.
178
177
179
178
These messages are all arriving at the default built-in endpoint for your IoT hub. In the next sections, we're going to create a custom endpoint and route some of these messages to storage based on the message properties. Those messages will stop appearing in IoT Explorer because messages only go to the built-in endpoint when they don't match any other routes in IoT hub.
180
179
@@ -215,7 +214,7 @@ Create an Azure Storage account and a container within that account, which will
215
214
216
215
1. In the storage account menu, select **Containers** from the **Data storage** section.
217
216
218
-
1. Select **Container** to create a new container.
217
+
1. Select **+ Container** to create a new container.
219
218
220
219

221
220
@@ -263,11 +262,11 @@ Now set up the routing for the storage account. In this section you define a new
263
262
264
263
1. Select **Message Routing** from the **Hub settings** section of the menu.
265
264
266
-
1. In the **Routes** tab, select **Add**.
265
+
1. In the **Routes** tab, select **+ Add**.
267
266
268
267

269
268
270
-
1. Select **Add endpoint** next to the **Endpoint** field, then select **Storage** from the dropdown menu.
269
+
1. Select **+ Add endpoint** next to the **Endpoint** field, then select **Storage** from the dropdown menu.
271
270
272
271

273
272
@@ -345,7 +344,9 @@ Once the route is created in IoT Hub and enabled, it will immediately start rout
345
344
346
345
### Monitor the built-in endpoint with IoT Explorer
347
346
348
-
Return to the IoT Explorer session on your development machine. Recall that the IoT Explorer monitors the built-in endpoint for your IoT hub. That means that now you should be seeing only the messages that are *not* being routed by the custom route we created. Watch the incoming messages for a few moments and you should only see messages where `level` is set to `normal` or `critical`.
347
+
Return to the IoT Explorer session on your development machine. Recall that the IoT Explorer monitors the built-in endpoint for your IoT hub. That means that now you should be seeing only the messages that are *not* being routed by the custom route we created.
348
+
349
+
Start the sample again by running the code. Watch the incoming messages for a few moments and you should only see messages where `level` is set to `normal` or `critical`.
349
350
350
351
### View messages in the storage container
351
352
@@ -361,7 +362,9 @@ Verify that the messages are arriving in the storage container.
361
362
362
363

363
364
364
-
1. Download the JSON file and confirm that it contains messages from your device that have the `level` property set to `storage`.
365
+
1. Select the JSON file, then select **Download** to download the JSON file. Confirm that the file contains messages from your device that have the `level` property set to `storage`.
0 commit comments