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
description: Use the Azure IoT Operations portal to manage your asset configurations remotely and enable data to flow from your assets to an MQTT broker.
3
+
description: Use the Azure IoT Operations portal or the Azure CLI to manage your asset configurations remotely and enable data to flow from your assets to an MQTT broker.
4
4
author: dominicbetts
5
5
ms.author: dobett
6
6
ms.topic: how-to
@@ -21,25 +21,22 @@ _OPC UA servers_ are software applications that communicate with assets. OPC UA
21
21
22
22
An _asset endpoint_ is a custom resource in your Kubernetes cluster that connects OPC UA servers to OPC UA connector modules. This connection enables an OPC UA connector to access an asset's data points. Without an asset endpoint, data can't flow from an OPC UA server to the Azure IoT OPC UA Broker (preview) instance and Azure IoT MQ (preview) instance. After you configure the custom resources in your cluster, a connection is established to the downstream OPC UA server and the server forwards telemetry to the OPC UA Broker instance.
23
23
24
-
This article describes how to use the Azure IoT Operations (preview) portal to:
24
+
This article describes how to use the Azure IoT Operations (preview) portal and the Azure CLI to:
25
25
26
26
- Define asset endpoints
27
27
- Add assets, and define tags and events.
28
28
29
29
These assets, tags, and events map inbound data from OPC UA servers to friendly names that you can use in the MQ broker and Azure IoT Data Processor (preview) pipelines.
30
30
31
-
You can also use the Azure CLI to manage assets and asset endpoints. To learn more, see:
To configure an assets endpoint, you need a running instance of Azure IoT Operations.
39
34
40
-
## Sign in to the Azure IoT Operations portal
35
+
## Sign in
41
36
42
-
Navigate to the [Azure IoT Operations portal](https://iotoperations.azure.com) in your browser and sign in by using your Microsoft Entra ID credentials.
37
+
# [Azure IoT Operations portal](#tab/portal)
38
+
39
+
To sign in to the Azure IoT Operations portal, navigate to the [Azure IoT Operations portal](https://iotoperations.azure.com) in your browser and sign in by using your Microsoft Entra ID credentials.
43
40
44
41
## Select your cluster
45
42
@@ -53,10 +50,22 @@ When you sign in, the portal displays a list of the Azure Arc-enabled Kubernetes
53
50
> [!TIP]
54
51
> You can use the filter box to search for clusters.
55
52
53
+
# [Azure CLI](#tab/cli)
54
+
55
+
Before you use the `az az iot ops asset` commands, sign in to the subscription that contains your Azure IoT Operations deployment:
56
+
57
+
```azurecli
58
+
az login
59
+
```
60
+
61
+
---
62
+
56
63
## Create an asset endpoint
57
64
58
65
By default, an Azure IoT Operations deployment includes a built-in OPC PLC simulator. To create an asset endpoint that uses the built-in OPC PLC simulator:
59
66
67
+
# [Azure IoT Operations portal](#tab/portal)
68
+
60
69
1. Select **Asset endpoints** and then **Create asset endpoint**:
61
70
62
71
:::image type="content" source="media/howto-manage-assets-remotely/asset-endpoints.png" alt-text="Screenshot that shows the asset endpoints page in the Azure IoT Operations portal.":::
@@ -75,14 +84,31 @@ By default, an Azure IoT Operations deployment includes a built-in OPC PLC simul
75
84
76
85
1. To save the definition, select **Create**.
77
86
78
-
This configuration deploys a new module called `opc-ua-connector-0` to the cluster. After you define an asset, an OPC UA connector pod discovers it. The pod uses the asset endpoint that you specify in the asset definition to connect to an OPC UA server.
87
+
# [Azure CLI](#tab/cli)
88
+
89
+
Run the following command:
90
+
91
+
```azurecli
92
+
az iot ops asset endpoint create --name opc-ua-connector-0 --target-address opc.tcp://opcplc-000000:50000 -g {your resource group name} --cluster {your cluster name}
93
+
```
94
+
95
+
> [!TIP]
96
+
> Use `az connectedk8s list` to list the clusters you have access to.
97
+
98
+
To learn more, see [az iot ops asset endpoint](/cli/azure/iot/ops/asset/endpoint).
99
+
100
+
---
101
+
102
+
This configuration deploys a new `assetendpointprofile` resource called `opc-ua-connector-0` to the cluster. After you define an asset, an OPC UA connector pod discovers it. The pod uses the asset endpoint that you specify in the asset definition to connect to an OPC UA server.
79
103
80
104
When the OPC PLC simulator is running, data flows from the simulator, to the connector, to the OPC UA broker, and finally to the MQ broker.
81
105
82
106
### Configure an asset endpoint to use a username and password
83
107
84
108
The previous example uses the `Anonymous` authentication mode. This mode doesn't require a username or password.
85
109
110
+
# [Azure IoT Operations portal](#tab/portal)
111
+
86
112
To use the `UsernamePassword` authentication mode, complete the following steps:
87
113
88
114
1. Follow the steps in [Configure OPC UA user authentication with username and password](howto-configure-opcua-authentication-options.md#configure-opc-ua-user-authentication-with-username-and-password) to add secrets for username and password in Azure Key Vault, and project them into Kubernetes cluster.
@@ -93,18 +119,50 @@ To use the `UsernamePassword` authentication mode, complete the following steps:
To use the `UsernamePassword` authentication mode, complete the following steps:
125
+
126
+
1. Follow the steps in [Configure OPC UA user authentication with username and password](howto-configure-opcua-authentication-options.md#configure-opc-ua-user-authentication-with-username-and-password) to add secrets for username and password in Azure Key Vault, and project them into Kubernetes cluster.
127
+
128
+
1. Use a command like the following example to create your asset endpoint:
### Configure an asset endpoint to use a transport authentication certificate
97
137
98
138
To configure the asset endpoint to use a transport authentication certificate, complete the following steps:
99
139
140
+
# [Azure IoT Operations portal](#tab/portal)
141
+
100
142
1. Follow the steps in [Configure OPC UA transport authentication](howto-configure-opcua-authentication-options.md#configure-opc-ua-transport-authentication) to add a transport certificate and private key to Azure Key Vault, and project them into Kubernetes cluster.
101
143
2. In Azure IoT Operations portal, select **Use transport authentication certificate** for the **Transport authentication** field and enter the certificate thumbprint.
102
144
145
+
# [Azure CLI](#tab/cli)
146
+
147
+
1. Follow the steps in [Configure OPC UA transport authentication](howto-configure-opcua-authentication-options.md#configure-opc-ua-transport-authentication) to add a transport certificate and private key to Azure Key Vault, and project them into Kubernetes cluster.
148
+
149
+
1. Use a command like the following example to create your asset endpoint:
To learn more, see [az iot ops asset](/cli/azure/iot/ops/asset).
156
+
157
+
---
158
+
103
159
## Add an asset, tags, and events
104
160
161
+
# [Azure IoT Operations portal](#tab/portal)
162
+
105
163
To add an asset in the Azure IoT Operations portal:
106
164
107
-
1. Select the **Assets** tab. If you haven't created any assets yet, you see the following screen:
165
+
1. Select the **Assets** tab. Before you create any assets, you see the following screen:
108
166
109
167
:::image type="content" source="media/howto-manage-assets-remotely/create-asset-empty.png" alt-text="Screenshot that shows an empty Assets tab in the Azure IoT Operations portal.":::
110
168
@@ -166,7 +224,7 @@ Now you can define the tags associated with the asset. To add OPC UA tags:
166
224
167
225
- **Sampling interval (milliseconds)**: The sampling interval indicates the fastest rate at which the OPC UA Server should sample its underlying source for data changes.
168
226
- **Publishing interval (milliseconds)**: The rate at which OPC UA Server should publish data.
169
-
-**Queue size**: The depth of the queue to hold the sampling data before it's published.
227
+
- **Queue size**: The depth of the queue to hold the sampling data before publishing it.
170
228
171
229
### Add tags in bulk to an asset
172
230
@@ -199,8 +257,38 @@ You can import up to 1000 OPC UA tags at a time from a CSV file:
199
257
> [!TIP]
200
258
> You can use the filter box to search for tags.
201
259
260
+
# [Azure CLI](#tab/cli)
261
+
262
+
Use the following command to add a "thermostat" asset by using the Azure CLI. The command adds two tags to the asset by using the `--data` parameter:
263
+
264
+
```azurecli
265
+
az iot ops asset create --name thermostat -g {your resource group name} --cluster {your cluster name} --endpoint opc-ua-connector-0 --description 'A simulated thermostat asset' --data data_source='ns=3;s=FastUInt10', name=temperature --data data_source='ns=3;s=FastUInt100', name='Tag 10'
266
+
```
267
+
268
+
When you create an asset by using the Azure CLI, you can define:
269
+
270
+
- Multiple tags by using the `--data` parameter multiple times.
271
+
- Multiple events by using the `--event` parameter multiple times.
272
+
- Optional information for the asset such as:
273
+
- Manufacturer
274
+
- Manufacturer URI
275
+
- Model
276
+
- Product code
277
+
- Hardware version
278
+
- Software version
279
+
- Serial number
280
+
- Documentation URI
281
+
- Default values for sampling interval, publishing interval, and queue size.
282
+
- Tag specific values for sampling interval, publishing interval, and queue size.
283
+
- Event specific values for sampling publishing interval, and queue size.
284
+
- The observability mode for each tag and event
285
+
286
+
---
287
+
202
288
### Add individual events to an asset
203
289
290
+
# [Azure IoT Operations portal](#tab/portal)
291
+
204
292
Now you can define the events associated with the asset. To add OPC UA events:
205
293
206
294
1. Select **Add > Add event**.
@@ -222,7 +310,7 @@ Now you can define the events associated with the asset. To add OPC UA events:
222
310
1. Select **Manage default settings** to configure default event settings for the asset. These settings apply to all the OPC UA events that belong to the asset. You can override these settings for each event that you add. Default event settings include:
223
311
224
312
-**Publishing interval (milliseconds)**: The rate at which OPC UA Server should publish data.
225
-
-**Queue size**: The depth of the queue to hold the sampling data before it's published.
313
+
-**Queue size**: The depth of the queue to hold the sampling data before publishing it.
226
314
227
315
### Add events in bulk to an asset
228
316
@@ -241,8 +329,27 @@ Review your asset and OPC UA tag and event details and make any adjustments you
241
329
242
330
:::image type="content" source="media/howto-manage-assets-remotely/review-asset.png" alt-text="A screenshot that shows how to review your asset, tags, and events in the Azure IoT Operations portal.":::
243
331
332
+
# [Azure CLI](#tab/cli)
333
+
334
+
When you create an asset by using the Azure CLI, you can define multiple events by using the `--event` parameter multiple times. The syntax for the `--event` parameter is similar to the `--data` parameter:
335
+
336
+
```azurecli
337
+
az iot ops asset create --name thermostat -g {your resource group name} --cluster {your cluster name} --endpoint opc-ua-connector-0 --description 'A simulated thermostat asset' --event event_notifier='ns=3;s=FastUInt12', name=warning
338
+
```
339
+
340
+
For each event that you define, you can specify the:
341
+
342
+
- Event notifier. This value is the event notifier from the OPC UA server.
343
+
- Event name. This value is the friendly name that you want to use for the event. If you don't specify an event name, the event notifier is used as the event name.
344
+
- Observability mode.
345
+
- Queue size.
346
+
347
+
---
348
+
244
349
## Update an asset
245
350
351
+
# [Azure IoT Operations portal](#tab/portal)
352
+
246
353
Find and select the asset you created previously. Use the **Properties**, **Tags**, and **Events** tabs to make any changes:
247
354
248
355
:::image type="content" source="media/howto-manage-assets-remotely/asset-update-property-save.png" alt-text="A screenshot that shows how to update an existing asset in the Azure IoT Operations portal.":::
@@ -261,19 +368,80 @@ You can also add, update, and delete events and properties in the same way.
261
368
262
369
When you're finished making changes, select **Save** to save your changes.
263
370
371
+
# [Azure CLI](#tab/cli)
372
+
373
+
To list your assets, use the following command:
374
+
375
+
```azurecli
376
+
az iot ops asset query -g {your resource group name}
377
+
```
378
+
379
+
> [!TIP]
380
+
> You can refine the query command to search for assets that match specific criteria. For example, you can search for assets by manufacturer.
381
+
382
+
To view the details of the thermostat asset, use the following command:
383
+
384
+
```azurecli
385
+
az iot ops asset show --name thermostat -g {your resource group}
386
+
```
387
+
388
+
To update an asset, use the `az iot ops asset update` command. For example, to update the asset's description, use a command like the following example:
389
+
390
+
```azurecli
391
+
az iot ops asset update --name thermostat --description 'A simulated thermostat asset' -g {your resource group}
392
+
```
393
+
394
+
To list the thermostat asset's tags, use the following command:
395
+
396
+
```azurecli
397
+
az iot ops asset data-point list --asset thermostat -g {your resource group}
398
+
```
399
+
400
+
To list the thermostat asset's events, use the following command:
401
+
402
+
```azurecli
403
+
az iot ops asset event list --asset thermostat -g {your resource group}
404
+
```
405
+
406
+
To add a new tag to the thermostat asset, use a command like the following example:
To delete a tag, use the `az iot ops asset data-point remove` command.
413
+
414
+
You can manage an asset's events by using the `az iot ops asset event` commands.
415
+
416
+
---
417
+
264
418
## Delete an asset
265
419
420
+
# [Azure IoT Operations portal](#tab/portal)
421
+
266
422
To delete an asset, select the asset you want to delete. On the **Asset** details page, select **Delete**. Confirm your changes to delete the asset:
267
423
268
424
:::image type="content" source="media/howto-manage-assets-remotely/asset-delete.png" alt-text="A screenshot that shows how to delete an asset from the Azure IoT Operations portal.":::
269
425
426
+
# [Azure CLI](#tab/cli)
427
+
428
+
To delete an asset, use a command that looks like the following example:
429
+
430
+
```azurecli
431
+
az iot ops asset delete --name thermostat -g {your resource group name}
432
+
```
433
+
434
+
---
435
+
270
436
## Notifications
271
437
272
-
Whenever you make a change to asset, you see a notification in the Azure IoT Operations portal that reports the status of the operation:
438
+
Whenever you make a change to assetin the Azure IoT Operations portal, you see a notification that reports the status of the operation:
273
439
274
440
:::image type="content" source="media/howto-manage-assets-remotely/portal-notifications.png" alt-text="A screenshot that shows the notifications in the Azure IoT Operations portal.":::
275
441
276
442
## Related content
277
443
278
444
-[Azure OPC UA Broker overview](overview-opcua-broker.md)
0 commit comments