Share via


az iot hub device-identity parent

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 hub device-identity parent command. Learn more about extensions.

Manage parent device relationships for IoT devices.

Commands

Name Description Type Status
az iot hub device-identity parent set

Set the parent device of a target device.

Extension GA
az iot hub device-identity parent show

Get the parent device of a target device.

Extension GA

az iot hub device-identity parent set

Set the parent device of a target device.

az iot hub device-identity parent set --device-id
                                      --parent-device-id --pd
                                      [--auth-type {key, login}]
                                      [--force]
                                      [--hub-name]
                                      [--login]
                                      [--resource-group]

Examples

Set the parent device of a target device.

az iot hub device-identity parent set -d {device_id} --pd {edge_device_id} -n {iothub_name}

Set the parent device of a target device and overwrite the existing parent.

az iot hub device-identity parent set -d {device_id} --pd {edge_device_id} -n {iothub_name} --force

Required Parameters

--device-id -d

Target Device Id.

--parent-device-id --pd

Id of edge device.

Optional Parameters

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

--auth-type

Indicates whether the operation should auto-derive a policy key or use the current Azure AD session. If the authentication type is login and the resource hostname is provided, resource lookup will be skipped unless needed.You can configure the default using az configure --defaults iothub-data-auth-type={auth-type-value}.

Property Value
Parameter group: Access Control Arguments
Default value: key
Accepted values: key, login
--force -f

Overwrites the device's parent device.

Property Value
Default value: False
--hub-name -n

IoT Hub name or hostname. Required if --login is not provided.

Property Value
Parameter group: IoT Hub Identifier Arguments
--login -l

This command supports an entity connection string with rights to perform action. Use to avoid session login via "az login". If both an entity connection string and name are provided the connection string takes priority. Required if --hub-name is not provided.

Property Value
Parameter group: IoT Hub Identifier Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

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 hub device-identity parent show

Get the parent device of a target device.

az iot hub device-identity parent show --device-id
                                       [--auth-type {key, login}]
                                       [--hub-name]
                                       [--login]
                                       [--resource-group]

Examples

Get the parent device of a target device.

az iot hub device-identity parent show -d {device_id} -n {iothub_name}

Required Parameters

--device-id -d

Target Device Id.

Optional Parameters

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

--auth-type

Indicates whether the operation should auto-derive a policy key or use the current Azure AD session. If the authentication type is login and the resource hostname is provided, resource lookup will be skipped unless needed.You can configure the default using az configure --defaults iothub-data-auth-type={auth-type-value}.

Property Value
Parameter group: Access Control Arguments
Default value: key
Accepted values: key, login
--hub-name -n

IoT Hub name or hostname. Required if --login is not provided.

Property Value
Parameter group: IoT Hub Identifier Arguments
--login -l

This command supports an entity connection string with rights to perform action. Use to avoid session login via "az login". If both an entity connection string and name are provided the connection string takes priority. Required if --hub-name is not provided.

Property Value
Parameter group: IoT Hub Identifier Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

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