az iot central device-template

Manage and configure IoT Central device templates.

Commands

az iot central device-template create

Create a device template in IoT Central.

az iot central device-template delete

Delete a device template from IoT Central.

az iot central device-template show

Get a device template from IoT Central.

az iot central device-template create

Create a device template in IoT Central.

az iot central device-template create --app-id
                                      --content
                                      --device-template-id
                                      [--central-api-uri]
                                      [--token]

Examples

Create a device template with payload read from a file

az iot central device-template create --app-id {appid} --content {pathtofile} --device-template-id {devicetemplateid}

Create a device template with payload read from raw json

az iot central device-template create --app-id {appid} --content {json} --device-template-id {devicetemplateid}

Required Parameters

--app-id -n

Target App.

--content -k

Configuration for request. Provide path to JSON file or raw stringified JSON. [File Path Example: ./path/to/file.json] [Stringified JSON Example: {'a': 'b'}].

--device-template-id --dtid

Device template id. Example: somedevicetemplate.

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-template delete

Delete a device template from IoT Central.

Note: this is expected to fail if any devices are still associated to this template.

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

Examples

Delete a device template from IoT Central

az iot central device-template delete --app-id {appid} --device-template-id {devicetemplateid}

Required Parameters

--app-id -n

Target App.

--device-template-id --dtid

Device template id. Example: somedevicetemplate.

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-template show

Get a device template from IoT Central.

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

Examples

Get a device template

az iot central device-template show --app-id {appid} --device-template-id {devicetemplateid}

Required Parameters

--app-id -n

Target App.

--device-template-id --dtid

Device template id. Example: somedevicetemplate.

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