Monitor D2C messages in VS Code
Last updated
Last updated
Prerequisites
If you don’t have an Azure subscription, create a free account before you begin.
Install Visual Studio Code
Setup Azure IoT Hub through Sign in to Azure
In Explorer of VS Code, click "Azure IoT Hub Devices" in the bottom left corner.
Click "Select IoT Hub" in context menu.
If you have not signed in to Azure, a pop-up will show to let you sign in to Azure.
After signing in, your Azure Subscription list will be shown, then select an Azure Subscription.
Your IoT Hub list will be shown, then select an IoT Hub.
The device list will be shown.
You can access almost all Azure IoT Services provided by these extensions through the Command Palette. Simply press F1, then type in IoT to find available commands.
Monitor IoT Hub D2C message in Visual Studio Code
While you could send message to your IoT Hub, it is also possible to monitor those messages in Visual Studio Code.
Right-click your device and select Start Monitoring Built-in Event Endpoint.
The monitored messages will be shown in OUTPUT > Azure IoT Hub view.
To stop monitoring, right-click the OUTPUT view and select Stop Monitoring Built-in Event Endpoint.