az iot adr ns group

Note

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

Command group 'iot adr ns' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Manage Device Registry namespace groups.

Commands

Name Description Type Status
az iot adr ns group count

Show the current member count of a group.

Extension Preview
az iot adr ns group create

Create a group in a Device Registry namespace.

Extension Preview
az iot adr ns group delete

Delete a group from a Device Registry namespace.

Extension Preview
az iot adr ns group list

List groups in a Device Registry namespace.

Extension Preview
az iot adr ns group list-members

List the current members of a group.

Extension Preview
az iot adr ns group refresh

Trigger an asynchronous refresh of a group's membership.

Extension Preview
az iot adr ns group show

Show a group in a Device Registry namespace.

Extension Preview
az iot adr ns group update

Update a group in a Device Registry namespace.

Extension Preview
az iot adr ns group wait

Wait for a Device Registry group to reach a desired state.

Extension Preview

az iot adr ns group count

Preview

Command group 'iot adr ns group' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Show the current member count of a group.

az iot adr ns group count --gn --group-name --name
                          --namespace --ns
                          --resource-group
                          [--acquire-policy-token]
                          [--change-reference]

Examples

Show member count

az iot adr ns group count -n myGroup --ns myNamespace -g myResourceGroup

Required Parameters

--gn --group-name --name -n

Name of the group.

--namespace --ns

Name of the Device Registry namespace.

--resource-group -g

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

Optional Parameters

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

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
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 adr ns group create

Preview

Command group 'iot adr ns group' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Create a group in a Device Registry namespace.

The group's --group-type and --query-string are immutable after creation. Only 'RegistryDevice' is supported as the group type in the current preview API.

--query-string is passed to the service verbatim. Use '*' to include every device in the namespace.

Creating a group starts its initial membership calculation. Use 'az iot adr ns group wait' without a predicate to wait for that calculation. Manual membership refresh is rate-limited to once per hour.

az iot adr ns group create --gn --group-name --name
                           --namespace --ns
                           --qs --query-string
                           --resource-group
                           [--acquire-policy-token]
                           [--change-reference]
                           [--description]
                           [--display-name]
                           [--group-type --gt {RegistryDevice}]
                           [--location]
                           [--tags]

Examples

Create a group containing every device in the namespace

az iot adr ns group create -n myGroup --ns myNamespace -g myResourceGroup \
  --query-string "*"

Create a group with a membership query, display name and description

az iot adr ns group create -n myGroup --ns myNamespace -g myResourceGroup \
  --query-string "properties.manufacturer = 'Contoso'" \
  --display-name "Contoso devices" --description "All Contoso-manufactured devices"

Required Parameters

--gn --group-name --name -n

Name of the group.

--namespace --ns

Name of the Device Registry namespace.

--qs --query-string

Membership query filter used to determine which devices belong to the group. Use '*' to include every device in the namespace. Required and immutable after creation.

--resource-group -g

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

Optional Parameters

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

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--description

Human-readable description of the group.

--display-name

Human-readable display name for the group.

--group-type --gt

Type of the group. Only 'RegistryDevice' is supported in the current preview API; this is immutable after creation.

Property Value
Default value: RegistryDevice
Accepted values: RegistryDevice
--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

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 adr ns group delete

Preview

Command group 'iot adr ns group' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Delete a group from a Device Registry namespace.

Deletion completes synchronously and does not delete jobs or job runs. --no-wait is accepted for compatibility, but still waits for the delete response.

az iot adr ns group delete --gn --group-name --name
                           --namespace --ns
                           --resource-group
                           [--acquire-policy-token]
                           [--change-reference]
                           [--no-wait]
                           [--yes {false, true}]

Examples

Delete a group

az iot adr ns group delete -n myGroup --ns myNamespace -g myResourceGroup

Delete a group without confirmation prompt

az iot adr ns group delete -n myGroup --ns myNamespace -g myResourceGroup --yes

Required Parameters

--gn --group-name --name -n

Name of the group.

--namespace --ns

Name of the Device Registry namespace.

--resource-group -g

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

Optional Parameters

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

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--no-wait

Accepted for compatibility only; has no effect because group deletion is synchronous.

Property Value
Default value: False
--yes -y

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

Property Value
Accepted values: false, true
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 adr ns group list

Preview

Command group 'iot adr ns group' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List groups in a Device Registry namespace.

az iot adr ns group list --namespace --ns
                         --resource-group

Examples

List all groups in a namespace

az iot adr ns group list --ns myNamespace -g myResourceGroup

Required Parameters

--namespace --ns

Name of the Device Registry namespace.

--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 adr ns group list-members

Preview

Command group 'iot adr ns group' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List the current members of a group.

Follows the service's skip-token pagination and returns member resource ID objects.

az iot adr ns group list-members --gn --group-name --name
                                 --namespace --ns
                                 --resource-group
                                 [--acquire-policy-token]
                                 [--change-reference]
                                 [--page-size]
                                 [--skip-token]

Examples

List group members

az iot adr ns group list-members -n myGroup --ns myNamespace -g myResourceGroup

Required Parameters

--gn --group-name --name -n

Name of the group.

--namespace --ns

Name of the Device Registry namespace.

--resource-group -g

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

Optional Parameters

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

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--page-size

Maximum members per request. The service maximum is 1000.

--skip-token

Opaque token from which to start listing members.

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 adr ns group refresh

Preview

Command group 'iot adr ns group' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Trigger an asynchronous refresh of a group's membership.

Refreshing membership is a long-running operation. Use 'az iot adr ns group wait' to wait for the refresh to complete, or 'az iot adr ns group show' to poll the 'membershipState' field. If a membership calculation is already in progress, this command reuses that calculation instead of starting another. The service allows membership refresh at most once per hour, including the initial membership calculation triggered by group creation.

az iot adr ns group refresh --gn --group-name --name
                            --namespace --ns
                            --resource-group
                            [--acquire-policy-token]
                            [--change-reference]
                            [--no-wait]

Examples

Refresh group membership

az iot adr ns group refresh -n myGroup --ns myNamespace -g myResourceGroup

Required Parameters

--gn --group-name --name -n

Name of the group.

--namespace --ns

Name of the Device Registry namespace.

--resource-group -g

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

Optional Parameters

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

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Default value: False
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 adr ns group show

Preview

Command group 'iot adr ns group' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Show a group in a Device Registry namespace.

az iot adr ns group show --gn --group-name --name
                         --namespace --ns
                         --resource-group

Examples

Show group details

az iot adr ns group show -n myGroup --ns myNamespace -g myResourceGroup

Required Parameters

--gn --group-name --name -n

Name of the group.

--namespace --ns

Name of the Device Registry namespace.

--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 adr ns group update

Preview

Command group 'iot adr ns group' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Update a group in a Device Registry namespace.

Only mutable fields are exposed: --display-name, --description and --tags. The group's type and membership query cannot be changed after creation; recreate the group instead.

az iot adr ns group update --gn --group-name --name
                           --namespace --ns
                           --resource-group
                           [--acquire-policy-token]
                           [--change-reference]
                           [--description]
                           [--display-name]
                           [--tags]

Examples

Update a group's display name

az iot adr ns group update -n myGroup --ns myNamespace -g myResourceGroup --display-name "New name"

Update a group's description and tags

az iot adr ns group update -n myGroup --ns myNamespace -g myResourceGroup --description "Updated" --tags env=prod

Required Parameters

--gn --group-name --name -n

Name of the group.

--namespace --ns

Name of the Device Registry namespace.

--resource-group -g

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

Optional Parameters

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

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--description

Human-readable description of the group.

--display-name

Human-readable display name for the group.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

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 adr ns group wait

Preview

Command group 'iot adr ns group' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Wait for a Device Registry group to reach a desired state.

Without an explicit wait predicate, waits through membershipState Resolving until Ready and fails immediately on FailedToResolveMembers. Explicit standard wait predicates remain available.

az iot adr ns group wait --gn --group-name --name
                         --namespace --ns
                         --resource-group
                         [--acquire-policy-token]
                         [--change-reference]
                         [--created]
                         [--custom]
                         [--deleted]
                         [--exists]
                         [--interval]
                         [--timeout]
                         [--updated]

Examples

Wait until a group's membership refresh completes

az iot adr ns group wait -n myGroup --ns myNamespace -g myResourceGroup

Wait until a group is deleted

az iot adr ns group wait -n myGroup --ns myNamespace -g myResourceGroup --deleted

Required Parameters

--gn --group-name --name -n

Name of the group.

--namespace --ns

Name of the Device Registry namespace.

--resource-group -g

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

Optional Parameters

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

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--created

Wait until provisioningState is Succeeded.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--custom

Wait until a custom JMESPath expression evaluates to true.

Property Value
Parameter group: Wait Condition Arguments
--deleted

Wait until the resource is deleted.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--exists

Wait until the resource exists.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--interval

Polling interval in seconds.

Property Value
Parameter group: Wait Condition Arguments
Default value: 30
--timeout

Polling budget in seconds, including GET time. An in-flight GET is bounded by transport timeouts and cannot be interrupted by this polling deadline.

Property Value
Parameter group: Wait Condition Arguments
Default value: 3600
--updated

Wait until provisioningState is Succeeded.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
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