แชร์ผ่าน


az iot central device-template

Note

This reference is part of the azure-iot extension for the Azure CLI (version 2.59.0 or higher). The extension will automatically install the first time you run an az iot central device-template command. Learn more about extensions.

Manage and configure IoT Central device templates.

Commands

Name Description Type Status
az iot central device-template create

Create a device template in IoT Central.

Extension GA
az iot central device-template delete

Delete a device template from IoT Central.

Extension GA
az iot central device-template list

Get the list of device templates for an IoT Central application.

Extension GA
az iot central device-template show

Get a device template from IoT Central.

Extension GA
az iot central device-template update

Update a device template in IoT Central.

Extension GA

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 --dtid
                                      [--api-version --av {2022-06-30-preview, 2022-07-31}]
                                      [--central-api-uri --central-dns-suffix]
                                      [--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

The App ID of the IoT Central app you want to manage. You can find the App ID in the "About" page for your application under the help menu.

--content -k

The device template definition. Provide path to JSON file or raw stringified JSON. [File Path Example: ./path/to/file.json] [Example of stringified JSON: {Device Template JSON}]. The request body must contain CapabilityModel.

--device-template-id --dtid

Digital Twin Model Identifier of the device template. Learn more at https://aka.ms/iotcentraldtmi.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--api-version --av
Deprecated

Argument 'api_version' has been deprecated and will be removed in a future release.

This command parameter has been deprecated and will be ignored.In the future release, we will only support IoT Central APIs from latest GA version.If any API is not GA yet, we will call latest preview version.

Property Value
Default value: 2022-07-31
Accepted values: 2022-06-30-preview, 2022-07-31
--central-api-uri --central-dns-suffix

The IoT Central DNS suffix associated with your application.

Property Value
Default value: azureiotcentral.com
--token

If you'd prefer to submit your request without authenticating against the Azure CLI, you can specify a valid user token to authenticate your request. You must specify the type of key as part of the request. Learn more at https://aka.ms/iotcentraldocsapi.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

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 --dtid
                                      [--api-version --av {2022-06-30-preview, 2022-07-31}]
                                      [--central-api-uri --central-dns-suffix]
                                      [--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

The App ID of the IoT Central app you want to manage. You can find the App ID in the "About" page for your application under the help menu.

--device-template-id --dtid

The ID of the target device template. Example: somedevicetemplate.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--api-version --av
Deprecated

Argument 'api_version' has been deprecated and will be removed in a future release.

This command parameter has been deprecated and will be ignored.In the future release, we will only support IoT Central APIs from latest GA version.If any API is not GA yet, we will call latest preview version.

Property Value
Default value: 2022-07-31
Accepted values: 2022-06-30-preview, 2022-07-31
--central-api-uri --central-dns-suffix

The IoT Central DNS suffix associated with your application.

Property Value
Default value: azureiotcentral.com
--token

If you'd prefer to submit your request without authenticating against the Azure CLI, you can specify a valid user token to authenticate your request. You must specify the type of key as part of the request. Learn more at https://aka.ms/iotcentraldocsapi.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az iot central device-template list

Get the list of device templates for an IoT Central application.

az iot central device-template list --app-id
                                    [--api-version --av {2022-06-30-preview, 2022-07-31}]
                                    [--central-api-uri --central-dns-suffix]
                                    [--compact]
                                    [--token]

Examples

List all device templates in an application, sorted by template Id (default)

az iot central device-template list --app-id {appid}

Required Parameters

--app-id -n

The App ID of the IoT Central app you want to manage. You can find the App ID in the "About" page for your application under the help menu.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--api-version --av
Deprecated

Argument 'api_version' has been deprecated and will be removed in a future release.

This command parameter has been deprecated and will be ignored.In the future release, we will only support IoT Central APIs from latest GA version.If any API is not GA yet, we will call latest preview version.

Property Value
Default value: 2022-07-31
Accepted values: 2022-06-30-preview, 2022-07-31
--central-api-uri --central-dns-suffix

The IoT Central DNS suffix associated with your application.

Property Value
Default value: azureiotcentral.com
--compact -c

Show templates in compact mode. For each template will only display id, name and model types.

Property Value
Default value: False
--token

If you'd prefer to submit your request without authenticating against the Azure CLI, you can specify a valid user token to authenticate your request. You must specify the type of key as part of the request. Learn more at https://aka.ms/iotcentraldocsapi.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az iot central device-template show

Get a device template from IoT Central.

az iot central device-template show --app-id
                                    --device-template-id --dtid
                                    [--api-version --av {2022-06-30-preview, 2022-07-31}]
                                    [--central-api-uri --central-dns-suffix]
                                    [--token]

Examples

Get a device template

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

Required Parameters

--app-id -n

The App ID of the IoT Central app you want to manage. You can find the App ID in the "About" page for your application under the help menu.

--device-template-id --dtid

The ID of the target device template. Example: somedevicetemplate.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--api-version --av
Deprecated

Argument 'api_version' has been deprecated and will be removed in a future release.

This command parameter has been deprecated and will be ignored.In the future release, we will only support IoT Central APIs from latest GA version.If any API is not GA yet, we will call latest preview version.

Property Value
Default value: 2022-07-31
Accepted values: 2022-06-30-preview, 2022-07-31
--central-api-uri --central-dns-suffix

The IoT Central DNS suffix associated with your application.

Property Value
Default value: azureiotcentral.com
--token

If you'd prefer to submit your request without authenticating against the Azure CLI, you can specify a valid user token to authenticate your request. You must specify the type of key as part of the request. Learn more at https://aka.ms/iotcentraldocsapi.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az iot central device-template update

Update a device template in IoT Central.

az iot central device-template update --app-id
                                      --content
                                      --device-template-id --dtid
                                      [--api-version --av {2022-06-30-preview, 2022-07-31}]
                                      [--central-api-uri --central-dns-suffix]
                                      [--token]

Examples

Update a device template with payload read from a file

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

Update a device template with payload read from raw json

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

Required Parameters

--app-id -n

The App ID of the IoT Central app you want to manage. You can find the App ID in the "About" page for your application under the help menu.

--content -k

The device template definition. Provide path to JSON file or raw stringified JSON. [File Path Example: ./path/to/file.json] [Example of stringified JSON: {Device Template JSON}]. The request body must contain CapabilityModel.

--device-template-id --dtid

The ID of the target device template. Example: somedevicetemplate.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--api-version --av
Deprecated

Argument 'api_version' has been deprecated and will be removed in a future release.

This command parameter has been deprecated and will be ignored.In the future release, we will only support IoT Central APIs from latest GA version.If any API is not GA yet, we will call latest preview version.

Property Value
Default value: 2022-07-31
Accepted values: 2022-06-30-preview, 2022-07-31
--central-api-uri --central-dns-suffix

The IoT Central DNS suffix associated with your application.

Property Value
Default value: azureiotcentral.com
--token

If you'd prefer to submit your request without authenticating against the Azure CLI, you can specify a valid user token to authenticate your request. You must specify the type of key as part of the request. Learn more at https://aka.ms/iotcentraldocsapi.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False