Skip to content
Paymaun Heidari edited this page Jan 18, 2018 · 18 revisions

Tip#0 Append --help or -h to a command group or command for more information.

  • For command groups this will reveal the target group commands
  • For commands this will reveal information about parameters and may include usage examples.

Tip#1 Many commands require the default policy to exist on the target resource which is being manipulated. For example IoT Hub based commands commonly look for the iothubowner policy. This behavior will change in a future update.

Tip#2 For command parameters that take JSON, for example the az iot hub device-twin update command's --set parameter, JSON input is different between CMD/Powershell and Bash like shells.

The following should work with Bash:

az iot hub device-twin update -n myhub -d sensor1 --set tags='{"location":{"region":"US"}}'

az iot hub device-twin update -n PaymaunHub -d sensor1 --set tags="{\"location\":{\"region\":\"US\"}}"

az iot hub device-twin update -n PaymaunHub -d sensor1 --set tags="{'location':{'region':'US'}}"

The following should work with CMD/Powershell:

az iot hub device-twin update -n PaymaunHub -d sensor1 --set tags="{\"location\":{\"region\":\"US\"}}"

az iot hub device-twin update -n PaymaunHub -d sensor1 --set tags="{'location':{'region':'US'}}"

Clone this wiki locally