az iot ops ns asset custom 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 custom mgmt-action command. Learn more about extensions.
Manage actions within custom asset management groups.
Actions within management groups define specific operations that can be performed on custom assets. Each action has a target URI and can include custom configuration.
Commands
| Name | Description | Type | Status |
|---|---|---|---|
| az iot ops ns asset custom mgmt-action add |
Add an action to a custom asset management group. |
Extension | GA |
| az iot ops ns asset custom mgmt-action export |
Export management actions to file. |
Extension | GA |
| az iot ops ns asset custom mgmt-action import |
Import management actions from file. |
Extension | GA |
| az iot ops ns asset custom mgmt-action list |
List actions in a custom asset management group. |
Extension | GA |
| az iot ops ns asset custom mgmt-action remove |
Remove an action from a custom asset management group. |
Extension | GA |
az iot ops ns asset custom mgmt-action add
Add an action to a custom asset management group.
az iot ops ns asset custom mgmt-action add --asset
--group
--instance
--name
--resource-group
--target-uri --uri
[--acquire-policy-token]
[--action-type --at {Call, Read, Write}]
[--change-reference]
[--config]
[--replace {false, true}]
[--timeout --to]
[--topic]
[--tr --type-ref]
Examples
Add a basic action to a management group.
az iot ops ns asset custom mgmt-action add --asset myasset --instance myInstance -g myInstanceResourceGroup --group myManagementGroup --name myAction --target-uri /custom/device_service?Profile=Profile1
Add an action with custom configuration and timeout.
az iot ops ns asset custom mgmt-action add --asset myasset --instance myInstance -g myInstanceResourceGroup --group myManagementGroup --name myAction --target-uri /custom/device_service?Profile=Profile1 --config '{"method": "start", "parameters": {"speed": 100}}' --timeout 45
Add an action with specific action type and topic.
az iot ops ns asset custom mgmt-action add --asset myasset --instance myInstance -g myInstanceResourceGroup --group myManagementGroup --name myAction --target-uri /custom/device_service?Profile=Profile1 --action-type Control --topic factory/control/actions --timeout 30
Replace an existing action with the same name.
az iot ops ns asset custom mgmt-action add --asset myasset --instance myInstance -g myInstanceResourceGroup --group myManagementGroup --name myAction --target-uri /custom/device_service?Profile=Profile2 --config '{"method": "restart", "priority": "high"}' --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.
Target URI for the management action.
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 |
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 |
Custom action configuration as a JSON string or file path.
Replace the action if another action with the same name is already present.
| Property | Value |
|---|---|
| Default value: | False |
| Accepted values: | false, true |
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 custom mgmt-action export
Export management actions to file.
Export actions from a management group to JSON, YAML, or CSV format.
az iot ops ns asset custom 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 CSV.
az iot ops ns asset custom mgmt-action export -a myasset --instance myinstance -g myresourcegroup --group mygroup -f csv
Export actions to JSON.
az iot ops ns asset custom mgmt-action export -a myasset --instance myinstance -g myresourcegroup --group mygroup
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 action if another action with the same name is already 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 custom mgmt-action import
Import management actions from file.
Import actions from JSON, YAML, or CSV file. Use --replace to merge with overwrite. Default actionType is 'Call' if not specified.
az iot ops ns asset custom mgmt-action import --asset
--group
--if --input-file
--instance
--resource-group
[--acquire-policy-token]
[--change-reference]
[--replace {false, true}]
Examples
Import actions from CSV file.
az iot ops ns asset custom mgmt-action import -a myasset --instance myinstance -g myresourcegroup --group mygroup --if /path/to/actions.csv
Import actions with replace mode.
az iot ops ns asset custom mgmt-action import -a myasset --instance myinstance -g myresourcegroup --group mygroup --if /path/to/actions.json --replace
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 the action if another action with the same name is already 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 custom mgmt-action list
List actions in a custom asset management group.
az iot ops ns asset custom mgmt-action list --asset
--group
--instance
--resource-group
Examples
List all actions in a management group.
az iot ops ns asset custom mgmt-action list --asset myasset --instance myInstance -g myInstanceResourceGroup --group myManagementGroup
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 custom mgmt-action remove
Remove an action from a custom asset management group.
az iot ops ns asset custom 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 custom mgmt-action remove --asset myasset --instance myInstance -g myInstanceResourceGroup --group myManagementGroup --name myAction
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 |