az iot hub device-identity parent

Note

This reference is part of the azure-iot extension for Azure CLI and requires version 2.0.70 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 IoT device's parent device.

Commands

az iot hub device-identity parent set

Set the parent device of the specified device.

az iot hub device-identity parent show

Get the parent device of the specified device.

az iot hub device-identity parent set

Set the parent device of the specified device.

az iot hub device-identity parent set --device-id
                                      --parent-device-id
                                      [--force]
                                      [--hub-name]
                                      [--login]
                                      [--resource-group]

Examples

Set the parent device of the specified device.

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

Set the parent device of the specified device and overwrites its original parent.

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

Required Parameters

--device-id -d

Target Device.

--parent-device-id --pd

Id of edge device.

Optional Parameters

--force -f

Overwrites the device's parent device.

--hub-name -n

IoT Hub name.

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

--resource-group -g

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

az iot hub device-identity parent show

Get the parent device of the specified device.

az iot hub device-identity parent show --device-id
                                       [--hub-name]
                                       [--login]
                                       [--resource-group]

Examples

Get the parent device of the specified device.

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

Required Parameters

--device-id -d

Target Device.

Optional Parameters

--hub-name -n

IoT Hub name.

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

--resource-group -g

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