az iot ops ns asset mgmt-action
Note
This reference is part of the azure-iot-ops extension for the Azure CLI (version 2.70.0 or higher). The extension will automatically install the first time you run an az iot ops ns asset mgmt-action command. Learn more about extensions.
Manage actions for asset management groups in IoT Operations namespaces.
The connector type is detected automatically from the existing asset. For connector-specific parameters use --action-config (inline JSON or file). Use --show-template to discover the supported configuration schema for the asset's connector type.
Commands
| Name | Description | Type | Status |
|---|---|---|---|
| az iot ops ns asset mgmt-action add |
Add an action to an asset management group in an IoT Operations namespace. |
Extension | Preview |
| az iot ops ns asset mgmt-action export |
Export management group actions to file. |
Extension | Preview |
| az iot ops ns asset mgmt-action import |
Import management group actions from file. |
Extension | Preview |
| az iot ops ns asset mgmt-action list |
List actions for an asset management group in an IoT Operations namespace. |
Extension | Preview |
| az iot ops ns asset mgmt-action remove |
Remove an action from an asset management group in an IoT Operations namespace. |
Extension | Preview |
az iot ops ns asset mgmt-action add
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Add an action to an asset management group in an IoT Operations namespace.
The connector type is detected from the asset's device endpoint. Connector-specific configuration can be supplied via --action-config. Use --show-template to discover the supported config schema. For non-OPC UA connectors, a connector template must exist in the instance.
az iot ops ns asset mgmt-action add --asset
--group
--instance
--name
--resource-group
[--ac --action-config]
[--acquire-policy-token]
[--action-type --at {Call, Read, Write}]
[--change-reference]
[--replace {false, true}]
[--show-template {config, schema}]
[--target-uri --uri]
[--timeout --to]
[--topic]
[--tr --type-ref]
Examples
Add a basic action to any asset type
az iot ops ns asset mgmt-action add --asset myasset --instance myInstance -g myInstanceResourceGroup --group boilerControls --name restart --target-uri "opc.tcp://boiler/restart"
Show the action config template for the asset's connector type
az iot ops ns asset mgmt-action add --asset myasset --instance myInstance -g myInstanceResourceGroup --group boilerControls --name restart --show-template config
Add an action with connector-specific configuration from inline JSON
az iot ops ns asset mgmt-action add --asset myasset --instance myInstance -g myInstanceResourceGroup --group boilerControls --name restart --target-uri "opc.tcp://boiler/restart" --action-config '{"actionConfiguration": {"retryCount": 3}}'
Add an action with configuration from a file
az iot ops ns asset mgmt-action add --asset myasset --instance myInstance -g myInstanceResourceGroup --group boilerControls --name restart --target-uri "opc.tcp://boiler/restart" --action-config ./action_config.json
Replace an existing action
az iot ops ns asset mgmt-action add --asset myasset --instance myInstance -g myInstanceResourceGroup --group boilerControls --name restart --target-uri "opc.tcp://boiler/restart" --replace
Required Parameters
Asset name.
Management group name.
The name of the Azure IoT Operations instance.
Action name.
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.
Inline JSON string or path to a JSON/YAML file (.json, .yaml, .yml) containing connector-specific action configuration. The accepted key is 'actionConfiguration' (connector-specific config object). Use --show-template to discover the supported keys and schema for the asset's connector type. Cannot be combined with --show-template. For non-OPC UA connectors, a connector template must exist in the instance.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Type of management action.
| Property | Value |
|---|---|
| Default value: | Call |
| Accepted values: | Call, Read, Write |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Replace the action if another action with the same name is already present.
| Property | Value |
|---|---|
| Default value: | False |
| Accepted values: | false, true |
Show a starter action configuration template for the asset's connector type and exit without modifying the action. The connector type is read from the existing asset. config: fields shown with their default values (null if no default); output is directly usable as --action-config input. schema: every field includes type, default, and constraints (min, max, enum, pattern). Draft-07 $ref pointers (#/definitions/...) are resolved inline in both modes.
| Property | Value |
|---|---|
| Accepted values: | config, schema |
Target URI for the management action.
Timeout in seconds for this specific action. Minimum: 0.
Topic override for this specific action.
Type definition ID or URI.
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
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.
| Property | Value |
|---|---|
| Default value: | False |
az iot ops ns asset mgmt-action export
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Export management group actions to file.
az iot ops ns asset mgmt-action export --asset
--group
--instance
--resource-group
[--acquire-policy-token]
[--change-reference]
[--format {csv, json, yaml}]
[--od --output-dir]
[--replace {false, true}]
Examples
Export actions to JSON
az iot ops ns asset mgmt-action export --asset myasset --instance myInstance -g myInstanceResourceGroup --group boilerControls
Required Parameters
Asset name.
Management group name.
The name of the Azure IoT Operations instance.
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.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Export file format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | csv, json, yaml |
Output directory for export.
| Property | Value |
|---|---|
| Default value: | . |
Replace the local file if present.
| Property | Value |
|---|---|
| Default value: | False |
| Accepted values: | false, true |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
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.
| Property | Value |
|---|---|
| Default value: | False |
az iot ops ns asset mgmt-action import
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Import management group actions from file.
az iot ops ns asset mgmt-action import --asset
--group
--if --input-file
--instance
--resource-group
[--acquire-policy-token]
[--change-reference]
[--replace {false, true}]
Examples
Import actions from a JSON file
az iot ops ns asset mgmt-action import --asset myasset --instance myInstance -g myInstanceResourceGroup --group boilerControls --input-file ./actions.json
Required Parameters
Asset name.
Management group name.
Path to import file (JSON, YAML, or CSV).
The name of the Azure IoT Operations instance.
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.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Replace existing actions that share a name with an imported action.
| Property | Value |
|---|---|
| Default value: | False |
| Accepted values: | false, true |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
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.
| Property | Value |
|---|---|
| Default value: | False |
az iot ops ns asset mgmt-action list
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
List actions for an asset management group in an IoT Operations namespace.
az iot ops ns asset mgmt-action list --asset
--group
--instance
--resource-group
Examples
List all actions for a management group
az iot ops ns asset mgmt-action list --asset myasset --instance myInstance -g myInstanceResourceGroup --group boilerControls
Required Parameters
Asset name.
Management group name.
The name of the Azure IoT Operations instance.
The resource group of the Azure IoT Operations instance.
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
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.
| Property | Value |
|---|---|
| Default value: | False |
az iot ops ns asset mgmt-action remove
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Remove an action from an asset management group in an IoT Operations namespace.
az iot ops ns asset mgmt-action remove --asset
--group
--instance
--name
--resource-group
[--acquire-policy-token]
[--change-reference]
Examples
Remove an action from a management group
az iot ops ns asset mgmt-action remove --asset myasset --instance myInstance -g myInstanceResourceGroup --group boilerControls --name restart
Required Parameters
Asset name.
Management group name.
The name of the Azure IoT Operations instance.
Action name.
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.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
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.
| Property | Value |
|---|---|
| Default value: | False |