az iot adr ns device attribute

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 device attribute command. Learn more about extensions.

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

Manage Registry Device attributes.

User attributes are customer-authored. Microsoft.DeviceUpdate attributes are service-owned.

Commands

Name Description Type Status
az iot adr ns device attribute create

Create or replace a User-reported attribute.

Extension Preview
az iot adr ns device attribute delete

Delete an attribute by its literal resource name.

Extension Preview
az iot adr ns device attribute list

List attributes, including service-reported metadata.

Extension Preview
az iot adr ns device attribute show

Get an attribute.

Extension Preview

az iot adr ns device attribute create

Preview

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

Create or replace a User-reported attribute.

Properties must be a JSON object. User provenance is added automatically. Use schema identifiers and property values supported by your service; the CLI does not infer a schema or validate application-specific fields.

az iot adr ns device attribute create --an --attribute-name --name
                                      --device-name --dn --rdn --registry-device-name
                                      --namespace --ns
                                      --resource-group
                                      [--acquire-policy-token]
                                      [--change-reference]
                                      [--properties --props]
                                      [--schema]

Examples

Create an attribute from a JSON file.

az iot adr ns device attribute create -n my-attribute --rdn my-device --ns my-ns -g MyRG --properties @attribute.json

Required Parameters

--an --attribute-name --name -n

Name of the Registry Device attribute.

--device-name --dn --rdn --registry-device-name

Name of the parent Registry Device.

--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
--properties --props

Attribute properties as a JSON object or JSON file path (optionally prefixed by @). Service-owned Microsoft.DeviceUpdate provenance cannot be authored.

--schema

Schema identifier for the attribute. Use a schema supported by your service.

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 device attribute delete

Preview

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

Delete an attribute by its literal resource name.

az iot adr ns device attribute delete --an --attribute-name --name
                                      --device-name --dn --rdn --registry-device-name
                                      --namespace --ns
                                      --resource-group
                                      [--acquire-policy-token]
                                      [--change-reference]
                                      [--yes {false, true}]

Examples

Delete a customer-owned attribute.

az iot adr ns device attribute delete -n my-attribute --rdn my-device --ns my-ns -g MyRG --yes

Required Parameters

--an --attribute-name --name -n

Name of the Registry Device attribute.

--device-name --dn --rdn --registry-device-name

Name of the parent Registry Device.

--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
--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 device attribute list

Preview

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

List attributes, including service-reported metadata.

az iot adr ns device attribute list --device-name --dn --rdn --registry-device-name
                                    --namespace --ns
                                    --resource-group

Examples

List attributes.

az iot adr ns device attribute list --rdn my-device --ns my-ns -g MyRG

Required Parameters

--device-name --dn --rdn --registry-device-name

Name of the parent Registry Device.

--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 device attribute show

Preview

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

Get an attribute.

The software-update alias falls back to the canonical update attribute only after the literal name returns HTTP 404. Create and delete use literal names.

az iot adr ns device attribute show --an --attribute-name --name
                                    --device-name --dn --rdn --registry-device-name
                                    --namespace --ns
                                    --resource-group

Examples

Read an attribute.

az iot adr ns device attribute show -n my-attribute --rdn my-device --ns my-ns -g MyRG

Required Parameters

--an --attribute-name --name -n

Attribute name. If no literal match exists, software-update is an alias for the service-owned Device Update attribute named update.

--device-name --dn --rdn --registry-device-name

Name of the parent Registry Device.

--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