Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In this article, you learn how to use the Cloud Explorer for Visual Studio with various management options on your development computer. Cloud Explorer is a useful Visual Studio extension that enables you to view your Azure resources, inspect their properties and perform key developer actions from within Visual Studio. It comes with management options that you can use to perform various tasks.
Note
The features described in this article are available only in the standard tier of IoT Hub. For more information about the basic and standard/free IoT Hub tiers, see Choose the right IoT Hub tier for your solution.
Management option | Task |
---|---|
Direct methods | Make a device act such as starting or stopping sending messages or rebooting the device. |
Read device twin | Get the reported state of a device. For example, the device reports the LED is blinking now. |
Update device twin | Put a device into certain states, such as setting an LED to green or setting the telemetry send interval to 30 minutes. |
Cloud-to-device messages | Send notifications to a device. For example, "It is very likely to rain today. Don't forget to bring an umbrella." |
For more detailed explanation on the differences and guidance on using these options, see Device-to-cloud communication guidance and Cloud-to-device communication guidance.
Device twins are JSON documents that store device state information, including metadata, configurations, and conditions. IoT Hub persists a device twin for each device that connects to it. For more information about device twins, see Get started with device twins.
An active Azure subscription.
An Azure IoT Hub under your subscription.
Microsoft Visual Studio 2017 Update 9 or later. This article uses Visual Studio 2017 or Visual Studio 2019.
Cloud Explorer component from Visual Studio Installer, which is selected by default with Azure Workload.
The Cloud Explorer component from Visual Studio Installer for Visual Studio 2017 only supports monitoring device-to-cloud and cloud-to-device messages. To use Visual Studio 2017, download and install the latest Cloud Explorer.
In Visual Studio, select View > Cloud Explorer to open Cloud Explorer.
Select the Account Management icon to show your subscriptions.
If you are signed in to Azure, your accounts appear. To sign into Azure for the first time, choose Add an account.
Select the Azure subscriptions you want to use and choose Apply.
Expand your subscription, then expand IoT Hubs. Under each hub, you can see your devices for that hub. Right-click one device to access the management options.
To use direct methods, do the following steps:
Right-click your device and select Invoke Device Direct Method.
Enter the method name and payload in Invoke Direct Method, and then select OK.
Results appear in Output.
To edit a device twin, do the following steps:
Right-click your device and select Edit Device Twin.
An azure-iot-device-twin.json file opens with the content of device twin.
Make some edits of tags or properties.desired fields to the azure-iot-device-twin.json file.
Press Ctrl+S to update the device twin.
Results appear in Output.
To send a message from your IoT Hub to your device, follow these steps:
Right-click your device and select Send C2D Message.
Enter the message in Send C2D message and select OK.
Results appear in Output.
You've learned how to use Cloud Explorer for Visual Studio with various management options.
To continue to get started with Azure IoT Hub and to explore all extended IoT scenarios, see the following: