Κοινή χρήση μέσω


az iot du device group

Note

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

Device group management.

A device group is a collection of devices. Device groups provide a way to scale deployments to many devices. Each device belongs to exactly one device group at a time. A device group is automatically created when a Device Update-enabled device is connected to the hub and reports its properties.

Commands

Name Description Type Status
az iot du device group delete

Delete a device group.

Extension GA
az iot du device group list

List device groups within an instance.

Extension GA
az iot du device group show

Show details about a device group including the best update and update compliance.

Extension GA

az iot du device group delete

Delete a device group.

Device groups are not automatically cleaned up but are retained for history purposes. This operation can be used if there is no need for the group or need to retain history for it. If a device is ever connected again for a group after the group was deleted it will be automatically re-created with no history.

az iot du device group delete --account
                              --gid
                              --instance
                              [--resource-group]
                              [--yes {false, true}]

Examples

Delete a device group.

az iot du device group delete -n {account_name} -i {instance_name} --group-id {device_group_id}

Delete a device group skipping the confirmation prompt.

az iot du device group delete -n {account_name} -i {instance_name} --group-id {device_group_id} -y

Required Parameters

--account -n

Device Update account name. You can configure the default account name using az config set defaults.adu_account={name}.

--gid --group-id

Device group Id. This is created from the value of the ADUGroup tag in the connected IoT Hub's device/module twin or $default for devices with no tag.

--instance -i

Device Update instance name. You can configure the default instance name using az config set defaults.adu_instance={name}.

Optional Parameters

--resource-group -g

Device Update account resource group name. You can configure the default group using az config set defaults.adu_group={name}.

--yes -y

Skip user prompts. Indicates acceptance of action. Used primarily for automation scenarios. Default: false.

Accepted values: false, true
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 du device group list

List device groups within an instance.

az iot du device group list --account
                            --instance
                            [--order-by]
                            [--resource-group]

Examples

List device groups.

az iot du device group list -n {account_name} -i {instance_name}

List device groups in a desired order, in this case by deviceCount.

az iot du device group list -n {account_name} -i {instance_name} --order-by deviceCount

Required Parameters

--account -n

Device Update account name. You can configure the default account name using az config set defaults.adu_account={name}.

--instance -i

Device Update instance name. You can configure the default instance name using az config set defaults.adu_instance={name}.

Optional Parameters

--order-by

Orders the set of groups returned. You can order by groupId, deviceCount, createdDateTime, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount or subgroupsWithOnLatestUpdateCount.

--resource-group -g

Device Update account resource group name. You can configure the default group using az config set defaults.adu_group={name}.

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 du device group show

Show details about a device group including the best update and update compliance.

az iot du device group show --account
                            --gid
                            --instance
                            [--best-updates {false, true}]
                            [--resource-group]
                            [--update-compliance {false, true}]

Examples

Show a device group.

az iot du device group show -n {account_name} -i {instance_name} --group-id {device_group_id}

Show the best updates available for a device group. This flag modifies the command to returns a list.

az iot du device group show -n {account_name} -i {instance_name} --group-id {device_group_id} --best-updates

Show update compliance for a device group.

az iot du device group show -n {account_name} -i {instance_name} --group-id {device_group_id} --update-compliance

Required Parameters

--account -n

Device Update account name. You can configure the default account name using az config set defaults.adu_account={name}.

--gid --group-id

Device group Id. This is created from the value of the ADUGroup tag in the connected IoT Hub's device/module twin or $default for devices with no tag.

--instance -i

Device Update instance name. You can configure the default instance name using az config set defaults.adu_instance={name}.

Optional Parameters

--best-updates

Flag indicating the command should fetch the best available updates for the device group including a count of how many devices need each update. A best update is the latest update that meets all compatibility specifications of a device class.

Accepted values: false, true
--resource-group -g

Device Update account resource group name. You can configure the default group using az config set defaults.adu_group={name}.

--update-compliance

Flag indicating the command should fetch device group update compliance information such as how many devices are on their latest update, how many need new updates, and how many are in progress on receiving a new update.

Accepted values: false, true
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.