az iot hub device-identity children
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 children command. Learn more about extensions.
Manage children device relationships for IoT edge devices.
Commands
Name | Description | Type | Status |
---|---|---|---|
az iot hub device-identity children add |
Add devices as children to a target edge device. |
Extension | GA |
az iot hub device-identity children list |
Outputs the collection of assigned child devices. |
Extension | GA |
az iot hub device-identity children remove |
Remove child devices from a target edge device. |
Extension | GA |
az iot hub device-identity children add
Add devices as children to a target edge device.
az iot hub device-identity children add --child-list --cl
--device-id
[--auth-type {key, login}]
[--force]
[--hub-name]
[--login]
[--resource-group]
Examples
Add a space-separated list of device Ids as children to the target edge device.
az iot hub device-identity children add -d {edge_device_id} --child-list {child_device_id_1} {child_device_id_2} -n {iothub_name}
Add devices as children to the edge device and overwrite the children devices' existing parent.
az iot hub device-identity children add -d {edge_device_id} --child-list {child_device_id_1} {child_device_id_2} -n {iothub_name} -f
Required Parameters
Child device list (space separated).
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.
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 |
Overwrites the child device's parent device.
Property | Value |
---|---|
Default value: | False |
IoT Hub name or hostname. Required if --login is not provided.
Property | Value |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
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 |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az iot hub device-identity children list
Outputs the collection of assigned child devices.
az iot hub device-identity children list --device-id
[--auth-type {key, login}]
[--hub-name]
[--login]
[--resource-group]
Examples
List all assigned children devices.
az iot hub device-identity children list -d {edge_device_id} -n {iothub_name}
List all assigned children devices whose device Id contains a substring of 'test'.
az iot hub device-identity children list -d {edge_device_id} -n {iothub_name} --query "[?contains(@,'test')]"
Required Parameters
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.
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 |
IoT Hub name or hostname. Required if --login is not provided.
Property | Value |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
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 |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az iot hub device-identity children remove
Remove child devices from a target edge device.
az iot hub device-identity children remove --device-id
[--auth-type {key, login}]
[--child-list --cl]
[--hub-name]
[--login]
[--remove-all]
[--resource-group]
Examples
Remove a space-separated list of child devices from a target parent device.
az iot hub device-identity children remove -d {edge_device_id} --child-list {space_separated_device_id} -n {iothub_name}
Remove all child devices from a target parent device.
az iot hub device-identity children remove -d {edge_device_id} --remove-all
Required Parameters
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.
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 |
Child device list (space separated).
IoT Hub name or hostname. Required if --login is not provided.
Property | Value |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
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 |
To remove all children.
Property | Value |
---|---|
Default value: | False |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |