Search code examples
azure-cliazure-iot-hub

Azure Cli get specific device twin


Does someone know why I receive this table instead of my IotHub device twin with the azure cli ?

$iothub_name = 'iot-eu-iot-sandbox96587.azure-devices.net'
$device_id = 'SimulatedDevice'
az iot hub device-twin show --hub-name $iothub_name --device-id $device_id

enter image description here


Solution

    • Adding --output json to az iot hub device-twin show command from the MSDOC displayed the output in Json.
    • The command gets a device twin of IoTHub.
    • Thanks @MatthijsvanderVeer for your comment on the default display.
    az iot hub device-twin show --hub-name $iothub_name --device-id $device_id --output json
    

    Output: enter image description here