You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-operations/discover-manage-assets/howto-use-management-actions.md
+25-2Lines changed: 25 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ ai-usage: ai-assisted
13
13
14
14
# Enable and run management actions
15
15
16
-
Management actions let you invoke operations on southbound assets connected to your Azure IoT Operations instance. You can call methods, write values, and read values on assets such as OPC UA servers, ONVIF cameras, and MQTT devices. Management actions use Azure Event Grid to route requests and responses between the cloud and the internal MQTT broker The connector subscribes to a known topic on the internal MQTT broker and then executes the operation on the target asset.
16
+
Management actions let you invoke operations on southbound assets connected to your Azure IoT Operations instance. You can call methods, write values, and read values on assets such as OPC UA servers, ONVIF cameras, and MQTT devices. Management actions use Azure Event Grid to route requests and responses between the cloud and the internal MQTT broker. The connector subscribes to a known topic on the internal MQTT broker and then executes the operation on the target asset.
17
17
18
18
When you enable management actions, the Azure CLI provisions the infrastructure that connects Event Grid to the MQTT broker. This infrastructure includes an Event Grid data flow endpoint, a request data flow that uses a WebAssembly (WASM) module to process incoming messages, a response data flow that routes replies back through Event Grid, and the required topic spaces and permission bindings. After the infrastructure is in place, you can execute actions on any asset that has a management group and action defined.
19
19
@@ -96,11 +96,34 @@ az iot ops mgmt-actions execute \
96
96
> [!TIP]
97
97
> The `--payload` parameter supports inline JSON or a local file path that contains the JSON payload.
98
98
99
+
Not all call actions require a payload. For example, the ONVIF `GetDeviceInformation` action doesn't require any input parameters, so you can execute it without a payload:
100
+
101
+
```azurecli
102
+
az iot ops mgmt-actions execute \
103
+
--instance <instance-name> \
104
+
--resource-group <resource-group> \
105
+
--asset onvif-asset \
106
+
--group Device \
107
+
--action GetDeviceInformation
108
+
```
109
+
110
+
In this scenario, the following command returns a `Could not resolve the request schema for action 'GetDeviceInformation'...` error because the CLI attempts to validate the request against a non-existent schema:
111
+
112
+
```azurecli
113
+
az iot ops mgmt-actions execute \
114
+
--instance <instance-name> \
115
+
--resource-group <resource-group> \
116
+
--asset onvif-asset \
117
+
--group Device \
118
+
--action GetDeviceInformation \
119
+
--show-schema
120
+
```
121
+
99
122
### Action types
100
123
101
124
The payload depends on the action type and the target asset's management group definition:
102
125
103
-
-**Call** actions invoke a method on the asset. The payload contains the method's input parameters. To call a method that takes no parameters, set the payload to `'{}'`.
126
+
-**Call** actions invoke a method on the asset. If the method expects input parameters, the payload contains them.
104
127
-**Write** actions write a value to the target URI on the asset. The payload contains the value to write.
105
128
-**Read** actions read a value from the target URI. Use an empty payload `'{}'` for read actions.
0 commit comments