az iot central device

Manage and configure IoT Central devices.

Commands

az iot central device command

Run device 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 compute-device-key

Generate a derived device SAS key.

az iot central device create

Create a device in IoT Central.

az iot central device delete

Delete a device from IoT Central.

az iot central device registration-info

Get registration info on device(s) from IoT Central.

az iot central device show

Get a device from IoT Central.

az iot central device show-credentials

Get device credentials from IoT Central.

az iot central device twin

Manage IoT Central device twins.

az iot central device twin show

Get the device twin from IoT Hub.

az iot central device compute-device-key

Generate a derived device SAS key.

Generate a derived device key from a group-level SAS key.

az iot central device compute-device-key --device-id
                                         --pk

Examples

Basic usage

az iot central device compute-device-key --pk {primaryKey} --device-id {deviceid}

Required Parameters

--device-id -d

Target Device.

--pk --primary-key

The primary symmetric shared access key stored in base64 format.

az iot central device create

Create a device in IoT Central.

az iot central device create --app-id
                             --device-id
                             [--central-api-uri]
                             [--device-name]
                             [--instance-of]
                             [--simulated {false, true}]
                             [--token]

Examples

Create a device

az iot central device create --app-id {appid} --device-id {deviceid}

Create a simulated device

az iot central device create --app-id {appid} --device-id {deviceid} --instance-of {devicetemplateid} --simulated

Required Parameters

--app-id -n

Target App.

--device-id -d

Target Device.

Optional Parameters

--central-api-uri --central-dns-suffix

Central dns suffix. This enables running cli commands against non public/prod environments.

default value: azureiotcentral.com
--device-name

Human readable device name. Example: Fridge.

--instance-of

Central template id. Example: urn:ojpkindbz:modelDefinition:iild3tm_uo.

--simulated

Add this flag if you would like IoT Central to set this up as a simulated device. --instance-of is required if this is true.

accepted values: false, true
--token

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'.

az iot central device delete

Delete a device from IoT Central.

az iot central device delete --app-id
                             --device-id
                             [--central-api-uri]
                             [--token]

Examples

Delete a device

az iot central device delete --app-id {appid} --device-id {deviceid}

Required Parameters

--app-id -n

Target App.

--device-id -d

Target Device.

Optional Parameters

--central-api-uri --central-dns-suffix

Central dns suffix. This enables running cli commands against non public/prod environments.

default value: azureiotcentral.com
--token

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'.

az iot central device registration-info

Get registration info on device(s) from IoT Central.

Note: This command can take a significant amount of time to return if no device id is specified and your app contains a lot of devices.

az iot central device registration-info --app-id
                                        --device-id
                                        [--central-api-uri]
                                        [--token]

Examples

Get registration info on specified device

az iot central device registration-info --app-id {appid} --device-id {deviceid}

Required Parameters

--app-id -n

Target App.

--device-id -d

Target Device.

Optional Parameters

--central-api-uri --central-dns-suffix

Central dns suffix. This enables running cli commands against non public/prod environments.

default value: azureiotcentral.com
--token

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'.

az iot central device show

Get a device from IoT Central.

az iot central device show --app-id
                           --device-id
                           [--central-api-uri]
                           [--token]

Examples

Get a device

az iot central device show --app-id {appid} --device-id {deviceid}

Required Parameters

--app-id -n

Target App.

--device-id -d

Target Device.

Optional Parameters

--central-api-uri --central-dns-suffix

Central dns suffix. This enables running cli commands against non public/prod environments.

default value: azureiotcentral.com
--token

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'.

az iot central device show-credentials

Get device credentials from IoT Central.

az iot central device show-credentials --app-id
                                       --device-id
                                       [--central-api-uri]
                                       [--token]

Examples

Get device credentials for a device

az iot central device show-credentials --app-id {appid} --device-id {deviceid}

Required Parameters

--app-id -n

Target App.

--device-id -d

Target Device.

Optional Parameters

--central-api-uri --central-dns-suffix

Central dns suffix. This enables running cli commands against non public/prod environments.

default value: azureiotcentral.com
--token

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'.