Share via


az iot ops ns device

Note

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

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

Manage devices in Device Registry namespaces.

Commands

Name Description Type Status
az iot ops ns device create

Create a device in a Device Registry namespace.

Extension Preview
az iot ops ns device delete

Delete a device from a Device Registry namespace.

Extension Preview
az iot ops ns device endpoint

Manage endpoints for devices in Device Registry namespaces.

Extension Preview
az iot ops ns device endpoint inbound

Manage inbound endpoints for devices in Device Registry namespaces.

Extension Preview
az iot ops ns device endpoint inbound add

Add inbound endpoints to devices in Device Registry namespaces.

Extension Preview
az iot ops ns device endpoint inbound add custom

Add a custom inbound endpoint to a device in a Device Registry namespace.

Extension Preview
az iot ops ns device endpoint inbound add media

Add a media inbound endpoint to a device in a Device Registry namespace.

Extension Preview
az iot ops ns device endpoint inbound add onvif

Add an ONVIF inbound endpoint to a device in a Device Registry namespace.

Extension Preview
az iot ops ns device endpoint inbound add opcua

Add an OPC UA inbound endpoint to a device in a Device Registry namespace.

Extension Preview
az iot ops ns device endpoint inbound add rest

Add a rest inbound endpoint to a device in a Device Registry namespace.

Extension Preview
az iot ops ns device endpoint inbound list

List inbound endpoints of a device in a Device Registry namespace.

Extension Preview
az iot ops ns device endpoint inbound remove

Remove inbound endpoints from a device in a Device Registry namespace.

Extension Preview
az iot ops ns device endpoint list

List all endpoints of a device in a Device Registry namespace.

Extension Preview
az iot ops ns device query

Query devices in Device Registry namespaces.

Extension Preview
az iot ops ns device show

Show details of a device in a Device Registry namespace.

Extension Preview
az iot ops ns device update

Update a device in a Device Registry namespace.

Extension Preview

az iot ops ns device create

Preview

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

Create a device in a Device Registry namespace.

The device will be linked to an Azure IoT Operations instance.

az iot ops ns device create --instance
                            --name
                            --resource-group
                            [--attr --custom-attribute]
                            [--disabled {false, true}]
                            [--manufacturer]
                            [--model]
                            [--os]
                            [--os-version --osv]
                            [--tags]

Examples

Create a device with minimal configuration

az iot ops ns device create --name mydevice --instance myInstance -g myInstanceResourceGroup

Create a device with custom attributes

az iot ops ns device create --name mydevice --instance myInstance -g myInstanceResourceGroup --attr location=building1 floor=3

Create a device with manufacturer information and operating system details

az iot ops ns device create --name mydevice --instance myInstance -g myInstanceResourceGroup --manufacturer "Contoso" --model "Gateway X1" --os "Linux" --os-version "4.15"

Create a disabled device with tags

az iot ops ns device create --name mydevice --instance myInstance -g myInstanceResourceGroup --disabled --tags environment=test criticality=low

Required Parameters

--instance -i

The name of the Azure IoT Operations instance.

--name -n

The name of the device to create.

--resource-group -g

The resource group of the Azure IoT Operations instance.

Optional Parameters

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

--attr --custom-attribute

Space-separated key=value pairs corresponding to additional custom attributes for the device. This parameter can be used more than once.

--disabled

Disable the device.

Property Value
Parameter group: Additional Info Arguments
Accepted values: false, true
--manufacturer

The device manufacturer.

Property Value
Parameter group: Additional Info Arguments
--model

The device model.

Property Value
Parameter group: Additional Info Arguments
--os

The device operating system.

Property Value
Parameter group: Additional Info Arguments
--os-version --osv

The device operating system version.

Property Value
Parameter group: Additional Info Arguments
--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 ops ns device delete

Preview

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

Delete a device from a Device Registry namespace.

az iot ops ns device delete --instance
                            --name
                            --resource-group
                            [--yes {false, true}]

Examples

Delete a device

az iot ops ns device delete --name mydevice --instance myInstance -g myInstanceResourceGroup

Required Parameters

--instance -i

The name of the Azure IoT Operations instance.

--name -n

The name of the device to create.

--resource-group -g

The resource group of the Azure IoT Operations instance.

Optional Parameters

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

--yes -y

Confirm [y]es without a prompt. Useful for CI and automation scenarios.

Property Value
Default value: False
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 ops ns device query

Preview

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

Query devices in Device Registry namespaces.

Query devices across namespaces based on various search criteria including device name, manufacturer, model, and more.

az iot ops ns device query [--cq --custom-query]
                           [--disabled {false, true}]
                           [--instance]
                           [--manufacturer]
                           [--model]
                           [--name]
                           [--os]
                           [--os-version --osv]
                           [--resource-group]

Examples

Query for devices in an IoT Operations instance

az iot ops ns device query --instance myInstance -g myInstanceResourceGroup

Query for a specific device by name

az iot ops ns device query --name mydevice

Query for devices from a specific manufacturer

az iot ops ns device query --manufacturer "Contoso"

Use a custom query to search for devices

az iot ops ns device query --custom-query "where tags.environment=='production'"

Optional Parameters

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

--cq --custom-query

Custom query to use. All other query arguments, aside from instance name and resource group, will be ignored.

--disabled

State of asset.

Property Value
Parameter group: Additional Info Arguments
Accepted values: false, true
--instance -i

The name of the Azure IoT Operations instance.

--manufacturer

The device manufacturer.

Property Value
Parameter group: Additional Info Arguments
--model

The device model.

Property Value
Parameter group: Additional Info Arguments
--name -n

The name of the device to create.

--os

The device operating system.

Property Value
Parameter group: Additional Info Arguments
--os-version --osv

The device operating system version.

Property Value
Parameter group: Additional Info Arguments
--resource-group -g

The resource group of the Azure IoT Operations instance.

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 ops ns device show

Preview

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

Show details of a device in a Device Registry namespace.

az iot ops ns device show --instance
                          --name
                          --resource-group

Examples

Show details of a device

az iot ops ns device show --name mydevice --instance myInstance -g myInstanceResourceGroup

Required Parameters

--instance -i

The name of the Azure IoT Operations instance.

--name -n

The name of the device to create.

--resource-group -g

The resource group of the Azure IoT Operations instance.

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 ops ns device update

Preview

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

Update a device in a Device Registry namespace.

az iot ops ns device update --instance
                            --name
                            --resource-group
                            [--attr --custom-attribute]
                            [--disabled {false, true}]
                            [--os-version --osv]
                            [--tags]

Examples

Update device custom attributes

az iot ops ns device update --name mydevice --instance myInstance -g myInstanceResourceGroup --attr location=building2 floor=5

Update operating system version

az iot ops ns device update --name mydevice --instance myInstance -g myInstanceResourceGroup --os-version "4.18"

Disable a device

az iot ops ns device update --name mydevice --instance myInstance -g myInstanceResourceGroup --disabled

Update device tags

az iot ops ns device update --name mydevice --instance myInstance -g myInstanceResourceGroup --tags environment=production criticality=high

Required Parameters

--instance -i

The name of the Azure IoT Operations instance.

--name -n

The name of the device to create.

--resource-group -g

The resource group of the Azure IoT Operations instance.

Optional Parameters

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

--attr --custom-attribute

Space-separated key=value pairs corresponding to additional custom attributes for the device. This parameter can be used more than once.

--disabled

Disable the device.

Property Value
Parameter group: Additional Info Arguments
Accepted values: false, true
--os-version --osv

The device operating system version.

Property Value
Parameter group: Additional Info Arguments
--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