az iot central device command
Run device commands.
Commands
az iot central device command history |
Get most recent command-response request and response payload. |
az iot central device command run |
Run a command on a device and view associated response. Does NOT monitor property updates that the command may perform. |
az iot central device command history
Get most recent command-response request and response payload.
az iot central device command history --app-id
--cn
--device-id
--interface-id
[--central-api-uri]
[--token]
Examples
Show command response
az iot central device command history --app-id {appid} --device-id {deviceid} --interface-id {interfaceid} --command-name {commandname}
Required Parameters
Target App.
Command name as specified in device template. Example: run_firmware_update.
Target Device.
Interface name as specified in the device template. Example: c2dTestingTemplate_356.
Optional Parameters
Central dns suffix. This enables running cli commands against non public/prod environments.
Authorization token for request. More info available here: https://docs.microsoft.com/en-us/learn/modules/manage-iot-central-apps-with-rest-api/ MUST INCLUDE type (e.g. 'SharedAccessToken ...', 'Bearer ...'). Example: 'Bearer someBearerTokenHere'.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az iot central device command run
Run a command on a device and view associated response. Does NOT monitor property updates that the command may perform.
Note: payload should be nested under "request". i.e. if your device expects the payload in a shape {"key": "value"} payload should be {"request": {"key": "value"}}. --content can be pointed at a filepath too (.../path/to/payload.json).
az iot central device command run --app-id
--cn
--content
--device-id
--interface-id
[--central-api-uri]
[--token]
Examples
Run command response
az iot central device command run --app-id {appid} --device-id {deviceid} --interface-id {interfaceid} --command-name {commandname} --content {payload}
Short Run command response
az iot central device command run -n {appid} -d {deviceid} -i {interfaceid} --cn {commandname} -k {payload}
Required Parameters
Target App.
Command name as specified in device template. Example: run_firmware_update.
Configuration for request. Provide path to JSON file or raw stringified JSON. [File Path Example: ./path/to/file.json] [Stringified JSON Example: {'a': 'b'}].
Target Device.
Interface name as specified in the device template. Example: c2dTestingTemplate_356.
Optional Parameters
Central dns suffix. This enables running cli commands against non public/prod environments.
Authorization token for request. More info available here: https://docs.microsoft.com/en-us/learn/modules/manage-iot-central-apps-with-rest-api/ MUST INCLUDE type (e.g. 'SharedAccessToken ...', 'Bearer ...'). Example: 'Bearer someBearerTokenHere'.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.