Share via


az iot ops asset

Note

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

Asset management.

For more information on asset management, please see aka.ms/asset-overview.

Commands

Name Description Type Status
az iot ops asset create

Create an asset.

Extension GA
az iot ops asset dataset

Manage datasets in an asset.

Extension GA
az iot ops asset dataset list

List datasets within an asset.

Extension GA
az iot ops asset dataset point

Manage data-points in an asset dataset.

Extension GA
az iot ops asset dataset point add

Add a data point to an asset dataset.

Extension GA
az iot ops asset dataset point export

Export data-points in an asset dataset.

Extension GA
az iot ops asset dataset point import

Import data-points in an asset dataset.

Extension GA
az iot ops asset dataset point list

List data-points in an asset dataset.

Extension GA
az iot ops asset dataset point remove

Remove a data point in an asset dataset.

Extension GA
az iot ops asset dataset show

Show a dataset within an asset.

Extension GA
az iot ops asset delete

Delete an asset.

Extension GA
az iot ops asset endpoint

Manage asset endpoint profiles.

Extension GA
az iot ops asset endpoint create

Create asset endpoint profiles.

Extension GA
az iot ops asset endpoint create opcua

Create an asset endpoint profile for an OPCUA connector.

Extension GA
az iot ops asset endpoint delete

Delete an asset endpoint profile.

Extension GA
az iot ops asset endpoint query

Query the Resource Graph for asset endpoint profiles.

Extension GA
az iot ops asset endpoint show

Show an asset endpoint profile.

Extension GA
az iot ops asset endpoint update

Update an asset endpoint profile.

Extension GA
az iot ops asset event

Manage events in an asset.

Extension GA
az iot ops asset event add

Add an event to an asset.

Extension GA
az iot ops asset event export

Export events in an asset.

Extension GA
az iot ops asset event import

Import events in an asset.

Extension GA
az iot ops asset event list

List events in an asset.

Extension GA
az iot ops asset event remove

Remove an event in an asset.

Extension GA
az iot ops asset query

Query the Resource Graph for assets.

Extension GA
az iot ops asset show

Show an asset.

Extension GA
az iot ops asset update

Update an asset.

Extension GA

az iot ops asset create

Create an asset.

For examples of file formats, please see aka.ms/aziotops-assets.

az iot ops asset create --endpoint-profile --ep
                        --instance
                        --name
                        --resource-group
                        [--attr --custom-attribute]
                        [--dataset-publish-int --dpi]
                        [--dataset-queue-size --dqs]
                        [--dataset-sample-int --dsi]
                        [--description]
                        [--disable {false, true}]
                        [--display-name --dn]
                        [--documentation-uri --du]
                        [--eai --external-asset-id]
                        [--ef --event-file]
                        [--epi --event-publish-int]
                        [--eqs --event-queue-size]
                        [--esi --event-sample-int]
                        [--event]
                        [--hardware-revision --hr]
                        [--ig --instance-resource-group]
                        [--location]
                        [--manufacturer]
                        [--manufacturer-uri --mu]
                        [--model]
                        [--pc --product-code]
                        [--serial-number --sn]
                        [--software-revision --sr]
                        [--tags]
                        [--topic-path --tp]
                        [--topic-retain --tr {Keep, Never}]

Examples

Create an asset using the given instance in the same resource group.

az iot ops asset create --name myasset -g myresourcegroup --endpoint-profile myassetendpoint --instance myinstance

Create an asset using the given instance in a different resource group but same subscription. Note that the Digital Operations Experience may not display the asset if it is in a different subscription from the instance.

az iot ops asset create --name myasset -g myresourcegroup --endpoint-profile myassetendpoint --instance myinstance --instance-resource-group myinstanceresourcegroup

Create a disabled asset using a file containing events.

az iot ops asset create --name myasset -g myresourcegroup --endpoint-profile myassetendpoint --instance myinstance --event-file /path/to/myasset_events.csv --disable

Create an asset with the given pre-filled values.

az iot ops asset create --name myasset -g myresourcegroup --endpoint-profile myassetendpoint --instance myinstance --event event_notifier=EventNotifier1 name=myEvent1 observability_mode=log sampling_interval=10 queue_size=2 --event event_notifier=EventNotifier2 name=myEvent2 --dataset-publish-int 1250 --dataset-queue-size 2 --dataset-sample-int 30 --event-publish-int 750 --event-queue-size 3 --event-sample-int 50 --description 'Description for a test asset.' --documentation-uri www.contoso.com --external-asset-id 000-000-1234 --hardware-revision 10.0 --product-code XXX100 --software-revision 0.1 --manufacturer Contoso --manufacturer-uri constoso.com --model AssetModel --serial-number 000-000-ABC10 --custom-attribute work_location=factory

Required Parameters

--endpoint-profile --ep

Asset endpoint profile name.

--instance

Instance name to associate the created asset with.

--name -n

Asset name.

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

--attr --custom-attribute

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

Property Value
Parameter group: Additional Info Arguments
--dataset-publish-int --dpi

Default publishing interval for datasets.

Property Value
Parameter group: Dataset Default Arguments
Default value: 1000
--dataset-queue-size --dqs

Default queue size for datasets.

Property Value
Parameter group: Dataset Default Arguments
Default value: 1
--dataset-sample-int --dsi

Default sampling interval (in milliseconds) for datasets.

Property Value
Parameter group: Dataset Default Arguments
Default value: 500
--description -d

Description.

--disable

Disable an asset.

Property Value
Default value: False
Accepted values: false, true
--display-name --dn

Display name.

--documentation-uri --du

Documentation URI.

Property Value
Parameter group: Additional Info Arguments
--eai --external-asset-id

External asset Id.

Property Value
Parameter group: Additional Info Arguments
--ef --event-file

File path for the file containing the events. The following file types are supported: json, csv, yaml.

Property Value
Parameter group: Event Arguments
--epi --event-publish-int

Default publishing interval for events.

Property Value
Parameter group: Event Default Arguments
Default value: 1000
--eqs --event-queue-size

Default queue size for events.

Property Value
Parameter group: Event Default Arguments
Default value: 1
--esi --event-sample-int

Default sampling interval (in milliseconds) for events.

Property Value
Parameter group: Event Default Arguments
Default value: 500
--event

Space-separated key=value pairs corresponding to properties of the event to create. The following key values are supported: event_notifier (required), name (required), observability_mode (none or log), sampling_interval (int), queue_size (int). --event can be used 1 or more times. Review help examples for full parameter usage.

Property Value
Parameter group: Event Arguments
--hardware-revision --hr

Hardware revision.

Property Value
Parameter group: Additional Info Arguments
--ig --instance-resource-group

Instance resource group. If not provided, asset resource group will be used.

--location -l

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

--manufacturer

Manufacturer.

Property Value
Parameter group: Additional Info Arguments
--manufacturer-uri --mu

Manufacturer URI.

Property Value
Parameter group: Additional Info Arguments
--model

Model.

Property Value
Parameter group: Additional Info Arguments
--pc --product-code

Product code.

Property Value
Parameter group: Additional Info Arguments
--serial-number --sn

Serial number.

Property Value
Parameter group: Additional Info Arguments
--software-revision --sr

Software revision.

Property Value
Parameter group: Additional Info Arguments
--tags

Asset resource tags. Property bag in key-value pairs with the following format: a=b c=d.

--topic-path --tp

Default topic path.

Property Value
Parameter group: MQTT Topic Default Arguments
--topic-retain --tr

Default topic retain policy.

Property Value
Parameter group: MQTT Topic Default Arguments
Accepted values: Keep, Never
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 asset delete

Delete an asset.

az iot ops asset delete --name
                        --resource-group

Examples

Delete an asset.

az iot ops asset delete --name myasset -g myresourcegroup

Required Parameters

--name -n

Asset name.

--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 ops asset query

Query the Resource Graph for assets.

az iot ops asset query [--cq --custom-query]
                       [--description]
                       [--disabled {false, true}]
                       [--display-name --dn]
                       [--documentation-uri --du]
                       [--eai --external-asset-id]
                       [--endpoint-profile --ep]
                       [--hardware-revision --hr]
                       [--ig --instance-resource-group]
                       [--instance]
                       [--location]
                       [--manufacturer]
                       [--manufacturer-uri --mu]
                       [--model]
                       [--name]
                       [--pc --product-code]
                       [--resource-group]
                       [--serial-number --sn]
                       [--software-revision --sr]
                       [--topic-path --tp]
                       [--topic-retain --tr {Keep, Never}]

Examples

Query for assets that are disabled within a given resource group.

az iot ops asset query -g myresourcegroup --disabled

Query for assets that have the given model, manufacturer, and serial number.

az iot ops asset query --model model1 --manufacturer contoso --serial-number 000-000-ABC10

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 will be ignored.

--description -d

Description.

--disabled

State of asset.

Property Value
Parameter group: Additional Info Arguments
Accepted values: false, true
--display-name --dn

Display name.

--documentation-uri --du

Documentation URI.

Property Value
Parameter group: Additional Info Arguments
--eai --external-asset-id

External asset Id.

Property Value
Parameter group: Additional Info Arguments
--endpoint-profile --ep

Asset endpoint profile name.

--hardware-revision --hr

Hardware revision.

Property Value
Parameter group: Additional Info Arguments
--ig --instance-resource-group

Instance resource group. If not provided, asset resource group will be used.

--instance

Instance name to associate the created asset with.

--location -l

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

--manufacturer

Manufacturer.

Property Value
Parameter group: Additional Info Arguments
--manufacturer-uri --mu

Manufacturer URI.

Property Value
Parameter group: Additional Info Arguments
--model

Model.

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

Asset name.

--pc --product-code

Product code.

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

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

--serial-number --sn

Serial number.

Property Value
Parameter group: Additional Info Arguments
--software-revision --sr

Software revision.

Property Value
Parameter group: Additional Info Arguments
--topic-path --tp

Default topic path.

Property Value
Parameter group: MQTT Topic Default Arguments
--topic-retain --tr

Default topic retain policy.

Property Value
Parameter group: MQTT Topic Default Arguments
Accepted values: Keep, Never
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 asset show

Show an asset.

az iot ops asset show --name
                      --resource-group

Examples

Show the details of an asset.

az iot ops asset show --name myasset -g myresourcegroup

Required Parameters

--name -n

Asset name.

--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 ops asset update

Update an asset.

To update datasets and events, please use the command groups az iot ops asset dataset and az iot ops asset event respectively.

az iot ops asset update --name
                        --resource-group
                        [--attr --custom-attribute]
                        [--dataset-publish-int --dpi]
                        [--dataset-queue-size --dqs]
                        [--dataset-sample-int --dsi]
                        [--description]
                        [--disable {false, true}]
                        [--display-name --dn]
                        [--documentation-uri --du]
                        [--epi --event-publish-int]
                        [--eqs --event-queue-size]
                        [--esi --event-sample-int]
                        [--hardware-revision --hr]
                        [--manufacturer]
                        [--manufacturer-uri --mu]
                        [--model]
                        [--pc --product-code]
                        [--serial-number --sn]
                        [--software-revision --sr]
                        [--tags]
                        [--topic-path --tp]
                        [--topic-retain --tr {Keep, Never}]

Examples

Update an asset's dataset and event defaults.

az iot ops asset update --name myasset -g myresourcegroup --dataset-publish-int 1250 --dataset-queue-size 2 --dataset-sample-int 30 --event-publish-int 750 --event-queue-size 3 --event-sample-int 50

Update an asset's description, documentation uri, hardware revision, product code, and software revision.

az iot ops asset update --name myasset -g myresourcegroup --description "Updated test asset description." --documentation-uri www.contoso.com --hardware-revision 11.0 --product-code XXX102 --software-revision 0.2

Update an asset's manufacturer, manufacturer uri, model, serial number, and custom attribute.

az iot ops asset update --name myasset -g myresourcegroup --manufacturer Contoso --manufacturer-uri constoso2.com --model NewAssetModel --serial-number 000-000-ABC11 --custom-attribute work_location=new_factory --custom-attribute secondary_work_location=factory

Disable an asset and remove a custom attribute called "work_site".

az iot ops asset update --name myasset -g myresourcegroup --disable --custom-attribute work_site=""

Required Parameters

--name -n

Asset name.

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

--attr --custom-attribute

Space-separated key=value pairs corresponding to additional custom attributes for the asset. This parameter can be used more than once.To remove a custom attribute, please set the attribute's value to "".

Property Value
Parameter group: Additional Info Arguments
--dataset-publish-int --dpi

Default publishing interval for datasets.

Property Value
Parameter group: Dataset Default Arguments
--dataset-queue-size --dqs

Default queue size for datasets.

Property Value
Parameter group: Dataset Default Arguments
--dataset-sample-int --dsi

Default sampling interval (in milliseconds) for datasets.

Property Value
Parameter group: Dataset Default Arguments
--description -d

Description.

--disable

Disable an asset.

Property Value
Accepted values: false, true
--display-name --dn

Display name.

--documentation-uri --du

Documentation URI.

Property Value
Parameter group: Additional Info Arguments
--epi --event-publish-int

Default publishing interval for events.

Property Value
Parameter group: Event Default Arguments
--eqs --event-queue-size

Default queue size for events.

Property Value
Parameter group: Event Default Arguments
--esi --event-sample-int

Default sampling interval (in milliseconds) for events.

Property Value
Parameter group: Event Default Arguments
--hardware-revision --hr

Hardware revision.

Property Value
Parameter group: Additional Info Arguments
--manufacturer

Manufacturer.

Property Value
Parameter group: Additional Info Arguments
--manufacturer-uri --mu

Manufacturer URI.

Property Value
Parameter group: Additional Info Arguments
--model

Model.

Property Value
Parameter group: Additional Info Arguments
--pc --product-code

Product code.

Property Value
Parameter group: Additional Info Arguments
--serial-number --sn

Serial number.

Property Value
Parameter group: Additional Info Arguments
--software-revision --sr

Software revision.

Property Value
Parameter group: Additional Info Arguments
--tags

Asset resource tags. Property bag in key-value pairs with the following format: a=b c=d.

--topic-path --tp

Default topic path.

Property Value
Parameter group: MQTT Topic Default Arguments
--topic-retain --tr

Default topic retain policy.

Property Value
Parameter group: MQTT Topic Default Arguments
Accepted values: Keep, Never
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