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/quickstart-send-telemetry-node.md
+13-9Lines changed: 13 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,19 +79,19 @@ A device must be registered with your IoT hub before it can connect. In this qui
79
79
80
80
You'll use this value later in the quickstart.
81
81
82
-
1. You also need a _service connection string_ to enable the back-end application to connect to your IoT hub and retrieve the messages. The following command retrieves the service connection string for your IoT hub:
82
+
1. You also need the _Event Hubs-compatible endpoint_, _Event Hubs-compatible path_, and _service primary key_ from your IoT hub to enable the back-end application to connect to your IoT hub and retrieve the messages. The following commands retrieve these values for your IoT hub:
83
83
84
-
**YourIoTHubName**: Replace this placeholder below with the name you chose for your IoT hub.
84
+
**YourIoTHubName**: Replace this placeholder below with the name you choose for your IoT hub.
85
85
86
86
```azurecli-interactive
87
-
az iot hub show-connection-string --name {YourIoTHubName} --policy-name service --output table
88
-
```
87
+
az iot hub show --query properties.eventHubEndpoints.events.endpoint --name {YourIoTHubName}
89
88
90
-
Make a note of the service connection string, which looks like:
89
+
az iot hub show --query properties.eventHubEndpoints.events.path --name {YourIoTHubName}
az iot hub policy show --name service --query primaryKey --hub-name {YourIoTHubName}
92
+
```
93
93
94
-
You'll use this value later in the quickstart. This service connection string is different from the device connection string you noted in the previous step.
94
+
Make a note of these three values, which you'll use later in the quickstart.
95
95
96
96
## Send simulated telemetry
97
97
@@ -120,9 +120,13 @@ The back-end application connects to the service-side **Events** endpoint on you
120
120
121
121
1. Open another local terminal window, navigate to the root folder of the sample Node.js project. Then navigate to the **iot-hub\Quickstarts\read-d2c-messages** folder.
122
122
123
-
1. Open the **ReadDeviceToCloudMessages.js** file in a text editor of your choice.
123
+
1. Open the **ReadDeviceToCloudMessages.js** file in a text editor of your choice. Update the following variables and save your changes to the file.
124
124
125
-
Replace the value of the `connectionString` variable with the service connection string you made a note of earlier. Then save your changes to **ReadDeviceToCloudMessages.js**.
125
+
| Variable | Value |
126
+
| -------- | ----------- |
127
+
| `eventHubsCompatibleEndpoint` | Replace the value of the variable with the Event Hubs-compatible endpoint you made a note of earlier. |
128
+
| `eventHubsCompatiblePath` | Replace the value of the variable with the Event Hubs-compatible path you made a note of earlier. |
129
+
| `iotHubSasKey` | Replace the value of the variable with the service primary key you made a note of earlier. |
126
130
127
131
1. In the local terminal window, run the following commands to install the required libraries and run the back-end application:
0 commit comments