az iot ops asset

Note

This reference is part of the azure-iot-ops extension for the Azure CLI (version 2.46.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

Manage assets.

Commands

Name Description Type Status
az iot ops asset create

Create an asset.

Extension Preview
az iot ops asset data-point

Manage data points in an asset.

Extension Preview
az iot ops asset data-point add

Add a data point to an asset.

Extension Preview
az iot ops asset data-point list

List data points in an asset.

Extension Preview
az iot ops asset data-point remove

Remove a data point in 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 certificate

Manage owned certificates in an asset endpoint.

Extension Preview
az iot ops asset endpoint certificate add

Add an owned certificate to an asset endpoint.

Extension Preview
az iot ops asset endpoint certificate list

List owned certificates in an asset endpoint.

Extension Preview
az iot ops asset endpoint certificate remove

Remove an owned certificate in an asset endpoint.

Extension Preview
az iot ops asset endpoint create

Create an asset endpoint.

Extension Preview
az iot ops asset endpoint delete

Delete an asset endpoint.

Extension Preview
az iot ops asset endpoint query

Query the Resource Graph for asset endpoints.

Extension Preview
az iot ops asset endpoint show

Show an asset endpoint.

Extension Preview
az iot ops asset endpoint update

Update an asset endpoint.

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

Either custom location or cluster name must be provided. This command will check for the existance of the associated custom location and cluster and ensure that both are set up correctly with the microsoft.deviceregistry.assets extension.

At least one data point or event must be defined during asset creation.

az iot ops asset create --endpoint
                        --name
                        --resource-group
                        [--asset-type]
                        [--cl]
                        [--clrg]
                        [--cls]
                        [--cluster]
                        [--cluster-resource-group]
                        [--cluster-subscription]
                        [--data]
                        [--data-publish-int]
                        [--data-queue-size]
                        [--data-sample-int]
                        [--description]
                        [--disable {false, true}]
                        [--display-name]
                        [--documentation-uri]
                        [--eai]
                        [--epi]
                        [--eqs]
                        [--esi]
                        [--event]
                        [--hardware-revision]
                        [--location]
                        [--manufacturer]
                        [--manufacturer-uri]
                        [--model]
                        [--pc]
                        [--serial-number]
                        [--software-revision]
                        [--tags]

Examples

Create an asset using the given custom location.

az iot ops asset create --name {asset_name} -g {resource_group} --custom-location {custom_location} --endpoint {endpoint} --data data_source={data_source}

Create an asset using the given custom location and resource group for the custom location. The resource group must be included if there are multiple custom locations with the same name within a subscription.

az iot ops asset create --name {asset_name} -g {resource_group} --custom-location {custom_location} --custom-location-resource-group {custom_location_resource_group} --endpoint {endpoint} --data data_source={data_source}

Create an asset using the given cluster name. The resource group must be included if there are multiple clusters with the same name within a subscription.

az iot ops asset create --name {asset_name} -g {resource_group} --cluster {cluster} --cluster-resource-group {cluster_resource_group} --endpoint {endpoint} --event event_notifier={event_notifier}

Create an asset using the given cluster name and custom location.

az iot ops asset create --name {asset_name} -g {resource_group} --cluster {cluster} --custom-location {custom_location} --endpoint {endpoint} --event event_notifier={event_notifier}

Create an asset with custom data point and event defaults.

az iot ops asset create --name {asset_name} -g {resource_group} --custom-location {custom_location} --endpoint {endpoint} --data-publish-int {data_point_publishing_interval} --data-queue-size {data_point_queue_size} --data-sample-int {data_point_sampling_interval} --event-publish-int {event_publishing_interval} --event-queue-size {event_queue_size} --event-sample-int {event_sampling_interval} --event event_notifier={event_notifier}

Create an asset with custom asset type, description, documentation uri, external asset id, hardware revision, product code, and software revision.

az iot ops asset create --name {asset_name} -g {resource_group} --custom-location {custom_location} --endpoint {endpoint} --asset-type {asset_type} --description {description} --documentation-uri {documentation_uri} --external-asset-id {external_asset_id} --hardware-revision {hardware_revision} --product-code {product_code} --software-revision {software_revision} --data data_source={data_source}

Create an asset with two events, manufacturer, manufacturer uri, model, serial number.

az iot ops asset create --name {asset_name} -g {resource_group} --custom-location {custom_location} --endpoint {endpoint} --event capability_id={capability_id} event_notifier={event_notifier} name={name} observability_mode={observability_mode} sampling_interval={sampling_interval} queue_size={queue_size} --event event_notifier={event_notifier} --manufacturer {manufacturer} --manufacturer-uri {manufacturer_uri} --model {model} --serial-number {serial_number}

Create a disabled asset with two data points.

az iot ops asset create --name {asset_name} -g {resource_group} --custom-location {custom_location} --endpoint {endpoint} --disable --data capability_id={capability_id} data_source={data_source} name={name} observability_mode={observability_mode} sampling_interval={sampling_interval} queue_size={queue_size} --data data_source={data_source}

Create an asset with the given pre-filled values.

az iot ops asset create --name MyAsset -g MyRg --custom-location MyLocation --endpoint example.com --data capability_id=myTagId data_source=nodeId1 name=myTagName1 observability_mode=counter sampling_interval=10 queue_size=2 --data data_source=nodeId2 --data-publish-int 1000 --data-queue-size 1 --data-sample-int 30 --asset-type customAsset --description 'Description for a test asset.' --documentation-uri www.help.com --external-asset-id 000-000-0000 --hardware-revision 10.0 --product-code XXX100 --software-revision 0.1 --manufacturer Contoso --manufacturer-uri constoso.com --model AssetModel --serial-number 000-000-ABC10

Required Parameters

--endpoint

Asset endpoint name.

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

--asset-type --at

Asset type.

--cl --custom-location

Custom location used to associate asset with cluster.

--clrg --custom-location-resource-group

Resource group for custom location.

--cls --custom-location-subscription

Subscription Id for custom location. If not provided, asset subscription Id will be used.

--cluster -c

Cluster to associate the asset with.

--cluster-resource-group --crg

Resource group for cluster.

--cluster-subscription --cs

Subscription Id for cluster. If not provided, asset subscription Id will be used.

--data

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

--data-publish-int --dpi

Default publishing interval for data points.

default value: 1000
--data-queue-size --dqs

Default queue size for data points.

default value: 1
--data-sample-int --dsi

Default sampling interval (in milliseconds) for data points.

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.

--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: capability_id, event_notifier (required), name, observability_mode (none, gauge, counter, histogram, 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.

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

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 {asset_name} -g {resource_group}

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 [--asset-type]
                       [--cl]
                       [--description]
                       [--disabled {false, true}]
                       [--display-name]
                       [--documentation-uri]
                       [--eai]
                       [--endpoint]
                       [--hardware-revision]
                       [--location]
                       [--manufacturer]
                       [--manufacturer-uri]
                       [--model]
                       [--pc]
                       [--resource-group]
                       [--serial-number]
                       [--software-revision]

Examples

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

az iot ops asset query -g {resource_group} --disabled

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

az iot ops asset query --model {model} --manufacturer {manufacturer} --serial-number {serial_number}

Optional Parameters

--asset-type --at

Asset type.

--cl --custom-location

Custom location used to associate asset with cluster.

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

Asset endpoint name.

--hardware-revision --hr

Hardware revision.

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

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

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 {asset_name} -g {resource_group}

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 data points and events, please use the command groups az iot ops asset data-point and az iot ops asset events respectively.

az iot ops asset update --name
                        --resource-group
                        [--asset-type]
                        [--data-publish-int]
                        [--data-queue-size]
                        [--data-sample-int]
                        [--description]
                        [--disable {false, true}]
                        [--display-name]
                        [--documentation-uri]
                        [--eai]
                        [--epi]
                        [--eqs]
                        [--esi]
                        [--hardware-revision]
                        [--manufacturer]
                        [--manufacturer-uri]
                        [--model]
                        [--pc]
                        [--serial-number]
                        [--software-revision]
                        [--tags]

Examples

Update an asset's data point and event defaults.

az iot ops asset update --name {asset_name} -g {resource_group} --data-publish-int {data_point_publishing_interval} --data-queue-size {data_point_queue_size} --data-sample-int {data_point_sampling_interval} --event-publish-int {event_publishing_interval} --event-queue-size {event_queue_size} --event-sample-int {event_sampling_interval}

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

az iot ops asset update --name {asset_name} -g {resource_group} --asset-type {asset_type} --description {description} --documentation-uri {documentation_uri} --external-asset-id {external_asset_id} --hardware-revision {hardware_revision} --product-code {product_code} --software-revision {software_revision}

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

az iot ops asset update --name {asset_name} -g {resource_group} --manufacturer {manufacturer} --manufacturer-uri {manufacturer_uri} --model {model} --serial-number {serial_number}

Disable an asset.

az iot ops asset update --name {asset_name} -g {resource_group} --disable

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

--asset-type --at

Asset type.

--data-publish-int --dpi

Default publishing interval for data points.

--data-queue-size --dqs

Default queue size for data points.

--data-sample-int --dsi

Default sampling interval (in milliseconds) for data points.

--description -d

Description.

--disable

Disable an asset.

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

Display name.

--documentation-uri --du

Documentation URI.

--eai --external-asset-id

External asset Id.

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

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.