az iot du device class
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 class command. Learn more about extensions.
Device class and device class subgroup management.
A device class describes a set of devices which share a common set of attributes across groups while a device class subgroup is a subset of devices in a group that share the same device class id. Device classes are created automatically when Device Update-enabled devices are connected to the hub.
Commands
Name | Description | Type | Status |
---|---|---|---|
az iot du device class delete |
Delete a device class or device class subgroup. |
Extension | GA |
az iot du device class list |
List device classes or device class subgroups. |
Extension | GA |
az iot du device class show |
Show details about a device class or device class subgroup including installable updates, the best update and update compliance. |
Extension | GA |
az iot du device class update |
Update a device class. |
Extension | GA |
az iot du device class delete
Delete a device class or device class subgroup.
Device classes are automatically created when Device Update-enabled devices are connected to the hub but are not automatically cleaned up since they are referenced by device class subgroups. If all device class subgroups for a target device class are deleted then the device class itself can also be deleted to remove the records from the system and to stop checking the compatibility of the device class with new updates. If a device is ever reconnected its device class will be re-created if it does not exist.
az iot du device class delete --account
--cid
--instance
[--gid]
[--resource-group]
[--yes {false, true}]
Examples
Delete a device class.
az iot du device class delete -n {account_name} -i {instance_name} --class-id {device_class_id}
Delete a device class and skip the confirmation prompt.
az iot du device class delete -n {account_name} -i {instance_name} --class-id {device_class_id} -y
Delete a device class subgroup.
az iot du device class delete -n {account_name} -i {instance_name} --class-id {device_class_id} --group-id {device_group_id}
Required Parameters
Device Update account name. You can configure the default account name using az config set defaults.adu_account={name}
.
Device class Id. This is generated from the model Id and the compat properties reported by the device update agent in the Device Update PnP interface in IoT Hub. It is a hex-encoded SHA1 hash.
Device Update instance name. You can configure the default instance name using az config set defaults.adu_instance={name}
.
Optional Parameters
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.
Device Update account resource group name. You can configure the default group using az config set defaults.adu_group={name}
.
Skip user prompts. Indicates acceptance of action. Used primarily for automation scenarios. Default: false.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
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.
az iot du device class list
List device classes or device class subgroups.
az iot du device class list --account
--instance
[--filter]
[--gid]
[--resource-group]
Examples
List device classes within an instance.
az iot du device class list -n {account_name} -i {instance_name}
List instance device classes filtered by friendly name.
az iot du device class list -n {account_name} -i {instance_name} --filter "friendlyName eq 'my-favorite-class'"
List device class subgroups for the group.
az iot du device class list -n {account_name} -i {instance_name} --group-id {device_group_id}
List device class subgroups for the group, filtered by compatProperties/manufacturer.
az iot du device class list -n {account_name} -i {instance_name} --group-id {device_group_id} --filter "compatProperties/manufacturer eq 'Contoso'"
Required Parameters
Device Update account name. You can configure the default account name using az config set defaults.adu_account={name}
.
Device Update instance name. You can configure the default instance name using az config set defaults.adu_instance={name}
.
Optional Parameters
If provided with --group-id, supports filtering based on device class compat property names and values. For example "compatProperties/manufacturer eq 'Contoso'". Otherwise supports filtering by class friendly name.
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.
Device Update account resource group name. You can configure the default group using az config set defaults.adu_group={name}
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
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.
az iot du device class show
Show details about a device class or device class subgroup including installable updates, the best update and update compliance.
az iot du device class show --account
--cid
--instance
[--best-update {false, true}]
[--gid]
[--installable-updates {false, true}]
[--resource-group]
[--update-compliance {false, true}]
Examples
Show a device class.
az iot du device class show -n {account_name} -i {instance_name} --class-id {device_class_id}
Show installable updates for the device class. This flag modifies the command to returns a list.
az iot du device class show -n {account_name} -i {instance_name} --class-id {device_class_id} --installable-updates
Show a device class subgroup.
az iot du device class show -n {account_name} -i {instance_name} --class-id {device_class_id} --group-id {device_group_id}
Show the best update available for a device class subgroup.
az iot du device class show -n {account_name} -i {instance_name} --class-id {device_class_id} --group-id {device_group_id} --best-update
Show update compliance for a device class subgroup.
az iot du device class show -n {account_name} -i {instance_name} --class-id {device_class_id} --group-id {device_group_id} --update-compliance
Required Parameters
Device Update account name. You can configure the default account name using az config set defaults.adu_account={name}
.
Device class Id. This is generated from the model Id and the compat properties reported by the device update agent in the Device Update PnP interface in IoT Hub. It is a hex-encoded SHA1 hash.
Device Update instance name. You can configure the default instance name using az config set defaults.adu_instance={name}
.
Optional Parameters
Flag indicating the command should fetch the best available update for the device class subgroup including a count of how many devices need the update. Group Id is required for this flag. A best update is the latest update that meets all compatibility specifications of a device class.
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.
Flag indicating the command should fetch installable updates for the device class.
Device Update account resource group name. You can configure the default group using az config set defaults.adu_group={name}
.
Flag indicating the command should fetch device class subgroup 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. Group Id is required for this flag.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
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.
az iot du device class update
Update a device class.
az iot du device class update --account
--cid
--instance
[--friendly-name]
[--resource-group]
Examples
Update the device class friendly name.
az iot du device class update -n {account_name} -i {instance_name} --class-id {device_class_id} --friendly-name "EU-region"
Required Parameters
Device Update account name. You can configure the default account name using az config set defaults.adu_account={name}
.
Device class Id. This is generated from the model Id and the compat properties reported by the device update agent in the Device Update PnP interface in IoT Hub. It is a hex-encoded SHA1 hash.
Device Update instance name. You can configure the default instance name using az config set defaults.adu_instance={name}
.
Optional Parameters
The device class friendly name. The friendly name must be 1 - 100 characters and supports alphanumeric, dot and dash values.
Device Update account resource group name. You can configure the default group using az config set defaults.adu_group={name}
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
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.
Azure CLI