שתף באמצעות


az iot ops asset

Note

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

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

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 Preview
az iot ops asset dataset

Manage datasets in an asset.

Extension Preview
az iot ops asset dataset list

List datasets within an asset.

Extension Preview
az iot ops asset dataset point

Manage data-points in an asset dataset.

Extension Preview
az iot ops asset dataset point add

Add a data point to an asset dataset.

Extension Preview
az iot ops asset dataset point export

Export data-points in an asset dataset.

Extension Preview
az iot ops asset dataset point import

Import data-points in an asset dataset.

Extension Preview
az iot ops asset dataset point list

List data-points in an asset dataset.

Extension Preview
az iot ops asset dataset point remove

Remove a data point in an asset dataset.

Extension Preview
az iot ops asset dataset show

Show a dataset within an asset.

Extension Preview
az iot ops asset delete

Delete an asset.

Extension Preview
az iot ops asset endpoint

Manage asset endpoint profiles.

Extension Preview
az iot ops asset endpoint create

Create asset endpoint profiles.

Extension Preview
az iot ops asset endpoint create opcua

Create an asset endpoint profile with an OPCUA connector.

Extension Preview
az iot ops asset endpoint delete

Delete an asset endpoint profile.

Extension Preview
az iot ops asset endpoint query

Query the Resource Graph for asset endpoint profiles.

Extension Preview
az iot ops asset endpoint show

Show an asset endpoint profile.

Extension Preview
az iot ops asset endpoint update

Update an asset endpoint profile.

Extension Preview
az iot ops asset event

Manage events in an asset.

Extension Preview
az iot ops asset event add

Add an event to an asset.

Extension Preview
az iot ops asset event export

Export events in an asset.

Extension Preview
az iot ops asset event import

Import events in an asset.

Extension Preview
az iot ops asset event list

List events in an asset.

Extension Preview
az iot ops asset event remove

Remove an event in an asset.

Extension Preview
az iot ops asset query

Query the Resource Graph for assets.

Extension Preview
az iot ops asset show

Show an asset.

Extension Preview
az iot ops asset update

Update an asset.

Extension Preview

az iot ops asset create

Preview

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

Create an asset.

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

az iot ops asset create --endpoint-profile
                        --instance
                        --name
                        --resource-group
                        [--attr]
                        [--dataset-publish-int]
                        [--dataset-queue-size]
                        [--dataset-sample-int]
                        [--description]
                        [--disable {false, true}]
                        [--display-name]
                        [--documentation-uri]
                        [--eai]
                        [--ef]
                        [--epi]
                        [--eqs]
                        [--esi]
                        [--event]
                        [--hardware-revision]
                        [--ig]
                        [--instance-subscription]
                        [--location]
                        [--manufacturer]
                        [--manufacturer-uri]
                        [--model]
                        [--pc]
                        [--serial-number]
                        [--software-revision]
                        [--tags]
                        [--topic-path]
                        [--topic-retain {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

--attr --custom-attribute

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

--dataset-publish-int --dpi

Default publishing interval for datasets.

Default value: 1000
--dataset-queue-size --dqs

Default queue size for datasets.

Default value: 1
--dataset-sample-int --dsi

Default sampling interval (in milliseconds) for datasets.

Default value: 500
--description -d

Description.

--disable

Disable an asset.

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

Display name.

--documentation-uri --du

Documentation URI.

--eai --external-asset-id

External asset Id.

--ef --event-file

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

--epi --event-publish-int

Default publishing interval for events.

Default value: 1000
--eqs --event-queue-size

Default queue size for events.

Default value: 1
--esi --event-sample-int

Default sampling interval (in milliseconds) for events.

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.

--hardware-revision --hr

Hardware revision.

--ig --instance-resource-group

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

--instance-subscription --is
Deprecated

Argument 'instance_subscription' has been deprecated and will be removed in a future release.

Instance subscription id. If not provided, asset subscription id 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.

--manufacturer-uri --mu

Manufacturer URI.

--model

Model.

--pc --product-code

Product code.

--serial-number --sn

Serial number.

--software-revision --sr

Software revision.

--tags

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

--topic-path --tp

Default topic path.

--topic-retain --tr

Default topic retain policy.

Accepted values: Keep, Never
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az iot ops asset delete

Preview

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

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.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az iot ops asset query

Preview

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

Query the Resource Graph for assets.

az iot ops asset query [--cq]
                       [--description]
                       [--disabled {false, true}]
                       [--display-name]
                       [--documentation-uri]
                       [--eai]
                       [--endpoint-profile]
                       [--hardware-revision]
                       [--ig]
                       [--instance]
                       [--location]
                       [--manufacturer]
                       [--manufacturer-uri]
                       [--model]
                       [--name]
                       [--pc]
                       [--resource-group]
                       [--serial-number]
                       [--software-revision]
                       [--topic-path]
                       [--topic-retain {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

--cq --custom-query

Custom query to use. All other query arguments will be ignored.

--description -d

Description.

--disabled

State of asset.

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

Display name.

--documentation-uri --du

Documentation URI.

--eai --external-asset-id

External asset Id.

--endpoint-profile --ep

Asset endpoint profile name.

--hardware-revision --hr

Hardware revision.

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

--manufacturer-uri --mu

Manufacturer URI.

--model

Model.

--name -n

Asset name.

--pc --product-code

Product code.

--resource-group -g

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

--serial-number --sn

Serial number.

--software-revision --sr

Software revision.

--topic-path --tp

Default topic path.

--topic-retain --tr

Default topic retain policy.

Accepted values: Keep, Never
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az iot ops asset show

Preview

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

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.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az iot ops asset update

Preview

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

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]
                        [--dataset-publish-int]
                        [--dataset-queue-size]
                        [--dataset-sample-int]
                        [--description]
                        [--disable {false, true}]
                        [--display-name]
                        [--documentation-uri]
                        [--epi]
                        [--eqs]
                        [--esi]
                        [--hardware-revision]
                        [--manufacturer]
                        [--manufacturer-uri]
                        [--model]
                        [--pc]
                        [--serial-number]
                        [--software-revision]
                        [--tags]
                        [--topic-path]
                        [--topic-retain {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

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

--dataset-publish-int --dpi

Default publishing interval for datasets.

--dataset-queue-size --dqs

Default queue size for datasets.

--dataset-sample-int --dsi

Default sampling interval (in milliseconds) for datasets.

--description -d

Description.

--disable

Disable an asset.

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

Display name.

--documentation-uri --du

Documentation URI.

--epi --event-publish-int

Default publishing interval for events.

--eqs --event-queue-size

Default queue size for events.

--esi --event-sample-int

Default sampling interval (in milliseconds) for events.

--hardware-revision --hr

Hardware revision.

--manufacturer

Manufacturer.

--manufacturer-uri --mu

Manufacturer URI.

--model

Model.

--pc --product-code

Product code.

--serial-number --sn

Serial number.

--software-revision --sr

Software revision.

--tags

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

--topic-path --tp

Default topic path.

--topic-retain --tr

Default topic retain policy.

Accepted values: Keep, Never
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.