az iot central device twin

Note

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

Manage IoT Central device twins.

Commands

Name Description Type Status
az iot central device twin replace

Replace writable property values of a device, a device component or a device module or a device module component.

Extension GA
az iot central device twin show

Get all property values of a device, a device component, a device module or a device module component.

Extension GA
az iot central device twin update

Update writable property values of a device, a device component, a device module or a device module component.

Extension GA

az iot central device twin replace

Replace writable property values of a device, a device component or a device module or a device module component.

Providing --component-name, --module-name or both of them to replace device component properties, device module properties or device module component properties.

az iot central device twin replace --app-id
                                   --content
                                   --device-id
                                   [--api-version {2022-06-30-preview, 2022-07-31}]
                                   [--central-api-uri]
                                   [--co]
                                   [--mn]
                                   [--token]

Examples

Replace device properties

az iot central device twin replace --app-id {appid} --device-id {deviceid} -k {content}

Replace device component properties

az iot central device twin replace --app-id {appid} --device-id {deviceid} --co {componentname} -k {content}

Replace device module component properties

az iot central device twin replace --app-id {appid} --device-id {deviceid} --mn {modulename} --co {componentname} -k {content}

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

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-id -d

The device ID of the target device.You can find the device ID by, clicking on the Connect button on the Device Details page.

Optional Parameters

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

accepted values: 2022-06-30-preview, 2022-07-31
default value: 2022-07-31
--central-api-uri --central-dns-suffix

The IoT Central DNS suffix associated with your application.

default value: azureiotcentral.com
--co --component-name

The name of the device component.

--mn --module-name

The name of the device module.

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

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--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.

az iot central device twin show

Get all property values of a device, a device component, a device module or a device module component.

Providing --component-name, --module-name or both of them to get device component properties, device module properties or device module component properties.

az iot central device twin show --app-id
                                --device-id
                                [--api-version {2022-06-30-preview, 2022-07-31}]
                                [--central-api-uri]
                                [--co]
                                [--mn]
                                [--token]

Examples

Get device properties

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

Get device component properties

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

Get device module component properties

az iot central device twin show --app-id {appid} --device-id {deviceid} --mn {modulename} --co {componentname}

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-id -d

The device ID of the target device.You can find the device ID by, clicking on the Connect button on the Device Details page.

Optional Parameters

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

accepted values: 2022-06-30-preview, 2022-07-31
default value: 2022-07-31
--central-api-uri --central-dns-suffix

The IoT Central DNS suffix associated with your application.

default value: azureiotcentral.com
--co --component-name

The name of the device component.

--mn --module-name

The name of the device module.

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

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--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.

az iot central device twin update

Update writable property values of a device, a device component, a device module or a device module component.

Providing --component-name, --module-name or both of them to update device component properties, device module properties or device module component properties.

az iot central device twin update --app-id
                                  --content
                                  --device-id
                                  [--api-version {2022-06-30-preview, 2022-07-31}]
                                  [--central-api-uri]
                                  [--co]
                                  [--mn]
                                  [--token]

Examples

Update device properties

az iot central device twin update --app-id {appid} --device-id {deviceid} -k {content}

Update device component properties

az iot central device twin update --app-id {appid} --device-id {deviceid} --co {componentname} -k {content}

Update device module component properties

az iot central device twin update --app-id {appid} --device-id {deviceid} --mn {modulename} --co {componentname} -k {content}

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

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-id -d

The device ID of the target device.You can find the device ID by, clicking on the Connect button on the Device Details page.

Optional Parameters

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

accepted values: 2022-06-30-preview, 2022-07-31
default value: 2022-07-31
--central-api-uri --central-dns-suffix

The IoT Central DNS suffix associated with your application.

default value: azureiotcentral.com
--co --component-name

The name of the device component.

--mn --module-name

The name of the device module.

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

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--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.