az iot adr ns device
Note
This reference is part of the azure-iot extension for the Azure CLI (version 2.67.0 or higher). The extension will automatically install the first time you run an az iot adr ns device command. Learn more about extensions.
Manage Device Registry namespace devices.
Commands
| Name | Description | Type | Status |
|---|---|---|---|
| az iot adr ns device list |
List devices in a Device Registry namespace. |
Extension | GA |
| az iot adr ns device revoke |
Revoke credentials for a device in a Device Registry namespace. |
Extension | GA |
| az iot adr ns device show |
Show a device in a Device Registry namespace. |
Extension | GA |
| az iot adr ns device update |
Update a device in a Device Registry namespace. |
Extension | GA |
az iot adr ns device list
List devices in a Device Registry namespace.
az iot adr ns device list --namespace --ns
--resource-group
Examples
List all devices in a namespace
az iot adr ns device list --ns myNamespace -g myResourceGroup
Required Parameters
Name of the Device Registry namespace.
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 adr ns device revoke
Revoke credentials for a device in a Device Registry namespace.
This command revokes all active credentials for the specified device. The device will need to re-authenticate and obtain new credentials.
Use --disable to also prevent the device from obtaining new credentials.
az iot adr ns device revoke --device-name --dn --name
--namespace --ns
--resource-group
[--acquire-policy-token]
[--change-reference]
[--disable]
[--yes {false, true}]
Examples
Revoke device credentials
az iot adr ns device revoke -n myDevice --ns myNamespace -g myResourceGroup
Revoke credentials and disable the device
az iot adr ns device revoke -n myDevice --ns myNamespace -g myResourceGroup --disable
Required Parameters
Name of the device.
Name of the Device Registry namespace.
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.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Disable the device after revoking credentials. Prevents new credentials from being issued.
| Property | Value |
|---|---|
| Default value: | False |
Skip user prompts. Indicates acceptance of action. Used primarily for automation scenarios. Default: false.
| Property | Value |
|---|---|
| Accepted values: | false, true |
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 adr ns device show
Show a device in a Device Registry namespace.
az iot adr ns device show --device-name --dn --name
--namespace --ns
--resource-group
Examples
Show device details
az iot adr ns device show -n myDevice --ns myNamespace -g myResourceGroup
Required Parameters
Name of the device.
Name of the Device Registry namespace.
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 adr ns device update
Update a device in a Device Registry namespace.
az iot adr ns device update --device-name --dn --name
--namespace --ns
--resource-group
[--acquire-policy-token]
[--attributes]
[--change-reference]
[--enabled {false, true}]
[--os-version]
[--policy-resource-id]
[--tags]
Examples
Disable a device
az iot adr ns device update -n myDevice --ns myNamespace -g myResourceGroup --enabled false
Update device OS version
az iot adr ns device update -n myDevice --ns myNamespace -g myResourceGroup --os-version "2.0.1"
Required Parameters
Name of the device.
Name of the Device Registry namespace.
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.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Device attributes in JSON format.
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Enable or disable the device. A disabled device cannot authenticate with Microsoft Entra ID.
| Property | Value |
|---|---|
| Accepted values: | false, true |
Operating system version of the device.
Resource ID of the credential policy to associate with the device.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
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 |