Monitor device connectivity using Azure CLI
Use the Azure CLI IoT extension to see messages your devices are sending to IoT Central and observe changes in the device twin. You can use this tool to debug and observe device connectivity and diagnose issues of device messages not reaching the cloud or devices not responding to twin changes.
A work or school account in Azure, added as a user in an IoT Central application.
Prepare your environment for the Azure CLI
If you prefer to run CLI reference commands locally, install the Azure CLI. If you're running on Windows or macOS, consider running Azure CLI in a Docker container. For more information, see How to run the Azure CLI in a Docker container.
If you're using a local installation, sign in to the Azure CLI by using the az login command. To finish the authentication process, follow the steps displayed in your terminal. For other sign-in options, see Sign in with the Azure CLI.
When you're prompted, install the Azure CLI extension on first use. For more information about extensions, see Use extensions with the Azure CLI.
Install the IoT Central extension
Run the following command from your command line to install:
az extension add --name azure-iot
Check the version of the extension by running:
You should see the azure-iot extension is 0.9.9 or higher. If it is not, run:
az extension update --name azure-iot
Using the extension
The following sections describe common commands and options that you can use when you run
az iot central. To view the full set of commands and options, pass
az iot central or any of its subcommands.
Start by signing into the Azure CLI.
Get the Application ID of your IoT Central app
In Application > Management, copy the Application ID. You use this value in later steps.
Monitor the messages that are being sent to your IoT Central app from your devices. The output includes all headers and annotations.
az iot central diagnostics monitor-events --app-id <app-id> --properties all
View device properties
View the current read and read/write device properties for a given device.
az iot central device twin show --app-id <app-id> --device-id <device-id>
A suggested next step is to learn how to connect Azure IoT Edge for Linux on Windows (EFLOW).
Submit and view feedback for