Skip to content

Commit 6528c78

Browse files
authored
Merge pull request #112559 from JimacoMS3/event-hubs-client-refresh-node
Update node telemetry quickstart to use Event Hubs compatible endpoin…
2 parents edcd486 + 4a2e865 commit 6528c78

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

articles/iot-hub/quickstart-send-telemetry-node.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,19 @@ A device must be registered with your IoT hub before it can connect. In this qui
7979
8080
You'll use this value later in the quickstart.
8181
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:
8383
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.
8585
8686
```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}
8988
90-
Make a note of the service connection string, which looks like:
89+
az iot hub show --query properties.eventHubEndpoints.events.path --name {YourIoTHubName}
9190
92-
`HostName={YourIoTHubName}.azure-devices.net;SharedAccessKeyName=service;SharedAccessKey={YourSharedAccessKey}`
91+
az iot hub policy show --name service --query primaryKey --hub-name {YourIoTHubName}
92+
```
9393
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.
9595
9696
## Send simulated telemetry
9797
@@ -120,9 +120,13 @@ The back-end application connects to the service-side **Events** endpoint on you
120120
121121
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.
122122
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.
124124
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. |
126130
127131
1. In the local terminal window, run the following commands to install the required libraries and run the back-end application:
128132

0 commit comments

Comments
 (0)