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
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 export |
Export data points in an asset. |
Extension | Preview |
az iot ops asset data-point import |
Import data points in 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 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
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. For examples of file formats, please see aka.ms/aziotops-assets.
az iot ops asset create --endpoint
--name
--resource-group
[--asset-type]
[--attr]
[--cg]
[--cl]
[--clg]
[--cls]
[--cluster]
[--cluster-subscription]
[--data]
[--data-file]
[--data-publish-int]
[--data-queue-size]
[--data-sample-int]
[--description]
[--disable {false, true}]
[--display-name]
[--documentation-uri]
[--eai]
[--ef]
[--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 additional custom attributes.
az iot ops asset create --name {asset_name} -g {resource_group} --custom-location {custom_location} --endpoint {endpoint} --custom-attribute {attribute_key}={attribute_value} --custom-attribute {attribute_key}={attribute_value}
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 using a file containing data-points and another file containing events.
az iot ops asset create --name MyAsset -g MyRg --custom-location MyLocation --endpoint exampleEndpoint --data-file /path/to/myasset_datapoints.json --event-file /path/to/myasset_events.csv
Create an asset with the given pre-filled values.
az iot ops asset create --name MyAsset -g MyRg --custom-location MyLocation --endpoint exampleEndpoint --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 --custom-attribute work_location=factory
Required Parameters
Asset endpoint name.
Asset name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Asset type.
Space-separated key=value pairs corresponding to additional custom attributes for the asset.
Resource group for cluster.
Custom location used to associate asset with cluster.
Resource group for custom location.
Subscription Id for custom location. If not provided, asset subscription Id will be used.
Cluster to associate the asset with.
Subscription Id for cluster. If not provided, asset subscription Id will be used.
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.
File path for the file containing the data points. The following file types are supported: csv, json, portal-csv, yaml.
Default publishing interval for data points.
Default queue size for data points.
Default sampling interval (in milliseconds) for data points.
Description.
Disable an asset.
Display name.
Documentation URI.
External asset Id.
File path for the file containing the events. The following file types are supported: csv, json, portal-csv, yaml.
Default publishing interval for events.
Default queue size for events.
Default sampling interval (in milliseconds) for events.
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 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.
Location. Values from: az account list-locations
. You can configure the default location using az configure --defaults location=<location>
.
Manufacturer.
Manufacturer URI.
Model.
Product code.
Serial number.
Software revision.
Asset resource tags. Property bag in key-value pairs with the following format: a=b c=d.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az iot ops asset delete
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
Asset name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az iot ops asset query
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.
Custom location used to associate asset with cluster.
Description.
State of asset.
Display name.
Documentation URI.
External asset Id.
Asset endpoint name.
Hardware revision.
Location. Values from: az account list-locations
. You can configure the default location using az configure --defaults location=<location>
.
Manufacturer.
Manufacturer URI.
Model.
Product code.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Serial number.
Software revision.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az iot ops asset show
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
Asset name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az iot ops asset update
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]
[--attr]
[--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, and custom attribute.
az iot ops asset update --name {asset_name} -g {resource_group} --manufacturer {manufacturer} --manufacturer-uri {manufacturer_uri} --model {model} --serial-number {serial_number} --custom-attribute {attribute_key}={attribute_value}
Disable an asset and remove a custom attribute called "work_site".
az iot ops asset update --name {asset_name} -g {resource_group} --disable --custom-attribute work_site=""
Required Parameters
Asset name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Asset type.
Space-separated key=value pairs corresponding to additional custom attributes for the asset. To remove a custom attribute, please set the attribute's value to "".
Default publishing interval for data points.
Default queue size for data points.
Default sampling interval (in milliseconds) for data points.
Description.
Disable an asset.
Display name.
Documentation URI.
External asset Id.
Default publishing interval for events.
Default queue size for events.
Default sampling interval (in milliseconds) for events.
Hardware revision.
Manufacturer.
Manufacturer URI.
Model.
Product code.
Serial number.
Software revision.
Asset resource tags. Property bag in key-value pairs with the following format: a=b c=d.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.