Create and send commands to IoT devices
When a device isn't working properly, the system receives an alert. To troubleshoot the issue remotely, you can send a command by choosing a registered device or by using an existing IoT alert. The command is sent to IoT Hub, which then sends a cloud-to-device message.
Create a command
Typically, commands are formulated as JSON. You can construct a command manually or use a command definition, which is a set of preconfigured properties that you can add to a command.
You can send a command from an IoT alert or IoT device.
Selecting Send Command generates a pop-up form, where you can select a command definition or enter a command in the Message field.
For example, you could enter the following JSON string to reset a device.
{"CommandName":"Reset","Parameters":{"Reset":true}}
Selecting an existing command definition generates the JSON from the properties, as shown in the following screenshot.
Note
Because the command is generated as JSON in Dynamics 365, you need to add a Parse JSON action to extract the properties from the command and set the fields in the Run a device command action.