Skip to content

Commit 5a75b7e

Browse files
committed
update to azure - for the latest and greatest
1 parent db00bb8 commit 5a75b7e

3 files changed

Lines changed: 40 additions & 17 deletions

File tree

docs/docs/settings/services/iot-services/iot_azure.md

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,21 @@ The Certificate Authority file for Azure is downloaded from this page:
9797

9898
[Microsoft: Azure Certificate Authority Details](https://learn.microsoft.com/en-us/azure/security/fundamentals/azure-ca-details)
9999

100-
The file to download is the ***Baltimore CyberTrust Root*** entry in the **Root Certificate Authorities** section of the page.
101-
100+
The file to download is the ***DigiCert Global Root G2*** entry in the **Root Certificate Authorities** section of the page.
101+
<figure align="center">
102102
![Azure Root CA](/img/iot_az_ca_file.png)
103+
<figcaption>CA Selection</figcaption>
104+
</figure>
105+
106+
The CA file is in a binary format and requires conversion to a standard `pem` format (which starts with ```-----BEGIN CERTIFICATE-----``` to use by the DataLogger's Azure driver.
107+
108+
To convert the file, the following command is used at the command line of systems with openssl installed
109+
110+
```sh
111+
openssl x509 -inform DER -in yourcert.crt -out yourcert.pem
112+
```
113+
114+
Copy the file `yourcert.pem` to an SD card, insert the SD card into the Datalogger and enter the filename `yourcert.pen` in the Azure preferences, or use the JSON file mentioned in the following section.
103115

104116
## Setting Properties
105117

@@ -143,32 +155,43 @@ Once installed, and connected to Azure via the Azure Account extension, you can
143155

144156
### Connect to Your Azure IoT Hub
145157

146-
On the Explorer panel of Visual Studio Code, click on the **...** menu of the **AZURE IOT HUB** section. In the popup menu, select the **Select IoT Hub** menu entry.
158+
To validate that the DataLoggerIot is communicating with your Azure IoT Hub and the associated devices, several methods are available. All these methods read and post the messages or 'telemetry' sent by the DataLogger to the Azure IoT device.
147159

148-
![Select IoT Hub](/img/iot_az_iot_hub_sel.png)
160+
#### Using the Azure Command Line (CLI)
149161

150-
The available IoT Hubs are displayed in the editors command prompt. Select the desired hub and press ```Enter``` (or click).
162+
One of the fast methods to do this is using the Azure CLI.
151163

152-
![Select IoT Hub](/img/iot_az_iot_hub_sel_menu.png)
164+
First, install the Azure CLI. Instructions are provided here: [How to install the Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest).
153165

154-
### Select IoT Hub
166+
Once installed, the `azure-iot` CLI extension needs installation. This is done with the following command:
155167

156-
The hub is then displayed in the **AZURE IOT HUB** section of the editor Explorer. Expanding the **Devices** section of the Hub will list the example device created above.
168+
```sh
169+
az extension add --name azure-iot
170+
```
157171

158-
![Select IoT Hub](/img/iot_az_iot_hub_exp.png)
172+
Then make sure you have logged into the Azure with the following command:
159173

160-
### Monitoring
174+
```sh
175+
az login
176+
```
161177

162-
To monitor the telemetry data send to a device, right click on the device, ***TestDevice2023*** in this example, select the menu entry **Start Monitoring Build-in Event Endpoint**.
178+
Then to monitor telemetry, enter the following command:
163179

164-
![Start Monitoring](/img/iot_az_iot_start_mon.png)
180+
```sh
181+
az iot hub monitor-events --hub-name <your-hub> --output table
182+
```
165183

166-
Once selected, the editor output console will start displaying output for the selected device. For the above example, with a device that has environmental sensors attached, the output appears as follows:
184+
Where `<your-hub>` is the name of your Azure IoT Hub.
167185

168-
![Monitor Output](/img/iot_az_iot_mon_output.png)
186+
You can also filter events for a specfic device using this variant of the command:
169187

170-
To stop monitoring, click the **Stop Monitoring build-in event endpoint** item that is displayed in the status bar of the editor.
188+
```sh
189+
az iot hub monitor-events --hub-name <your-hub> --device-id <device-id>
190+
```
171191

172-
![Stop Monitoring](/img/iot_az_iot_stop_mon.png)
192+
Where `<device-id>` is the ID of the device.
173193

174-
A menu option to stop monitoring is also available from the **...** menu of the **AZURE IOT HUB** section in the editor Explorer panel.
194+
<figure align="center">
195+
![Azure CLI Output](/img/iot_az_cli_monitor.png)
196+
<figcaption>Monitoring Azure Telemetry</figcaption>
197+
</figure>

docs/static/img/iot_az_ca_file.png

-1.29 KB
Loading
157 KB
Loading

0 commit comments

Comments
 (0)