Skip to content

Commit 032014a

Browse files
Merge pull request #268514 from timlt/update-akri
Confirm Akri instance connects to OPC UA Broker
2 parents 3db4b28 + 20ddf40 commit 032014a

File tree

1 file changed

+31
-9
lines changed

1 file changed

+31
-9
lines changed

articles/iot-operations/manage-devices-assets/howto-autodetect-opcua-assets-using-akri.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ms.date: 11/14/2023
1717

1818
In this article, you learn how to discover OPC UA data sources. After you deploy Azure IoT Operations, you configure Azure IoT Akri to discover OPC UA data sources at the edge. Azure IoT Akri creates custom resources into the Azure IoT Operations namespace on your cluster to represent the discovered devices. The capability to discover OPC UA data sources simplifies the process of manually configuring them from the cloud and onboarding them to your cluster. Currently, Azure IoT Akri can't detect and create assets that can be ingested into the Azure Device Registry. For more information on supported features, see [Azure IoT Akri overview](overview-akri.md#features).
1919

20-
Azure IoT Akri enables you to detect and create `Assets` in the address space of an OPC UA Server. The OPC UA asset detection generates `AssetType` and `Asset` Kubernetes custom resources (CRs) for [OPC UA Device Integration (DI) specification](https://reference.opcfoundation.org/DI/v104/docs/) compliant `Assets`.
20+
Azure IoT Akri enables you to detect and create `Assets` in the address space of an OPC UA server. The OPC UA asset detection generates `AssetType` and `Asset` Kubernetes custom resources (CRs) for [OPC UA Device Integration (DI) specification](https://reference.opcfoundation.org/DI/v104/docs/) compliant `Assets`.
2121

2222
## Prerequisites
2323

@@ -28,7 +28,7 @@ Azure IoT Akri enables you to detect and create `Assets` in the address space of
2828
kubectl get pods -n azure-iot-operations
2929
```
3030

31-
You should see the agent and discovery handler pod running:
31+
You should see the agent and discovery handler pod running.
3232

3333
```output
3434
NAME READY STATUS RESTARTS AGE
@@ -40,10 +40,10 @@ Azure IoT Akri enables you to detect and create `Assets` in the address space of
4040

4141
To configure the custom OPC UA discovery handler with asset detection, first you create a YAML configuration file using the values described in this section. Before you create the file, note the following configuration details:
4242

43-
- The specified server contains a sample address model that uses the Robotics companion specification, which is based on the DI specification. A model that uses these specifications is required for asset detection. The Robot contains five assets with observable variables and a `DeviceHealth` node that is automatically detected for monitoring.
43+
- The specified server contains a sample address model that uses the Robotics companion specification, which is based on the DI specification. A model that uses these specifications is required for asset detection. The Robot contains five assets with observable variables and a `DeviceHealth` node that is automatically detected for monitoring.
4444
- You can specify other servers by providing the `endpointUrl` and ensuring that a security `None` profile is enabled.
4545
- To enable Azure IoT Akri to discover the servers, confirm that you specified the correct discovery endpoint URL during installation.
46-
- Discovery URLs appear as `opc.tcp://<FQDN>:50000/`. To find the FQDNs of your OPC PLC servers, navigate to your deployments in the Azure portal. For each server, copy and paste the **FQDN** value into your discovery URLs. The following example demonstrates discovery of two OPC PLC servers. You can add the asset parameters for each OPC PLC server. If you only have one OPC PLC server, delete one of the assets.
46+
- Discovery URLs appear as `opc.tcp://<FQDN>:50000/`. To find the FQDNs of your OPC PLC servers, navigate to your deployments in the Azure portal. For each server, copy and paste the **FQDN** value into your discovery URLs. The following example demonstrates discovery of two OPC PLC servers. You can add the asset parameters for each OPC PLC server. If you only have one OPC PLC server, delete one of the assets.
4747

4848

4949
> [!div class="mx-tdBreakAll"]
@@ -59,7 +59,7 @@ To configure the custom OPC UA discovery handler with asset detection, first you
5959
² Temporary implementation until Azure IoT Akri can pass K8S secrets.
6060

6161

62-
1. To create the YAML configuration file, copy and paste the following content into a new file, and save it as `opcua-configuration.yaml`.
62+
1. To create the YAML configuration file, copy and paste the following content into a new file, and save it as `opcua-configuration.yaml`:
6363

6464
If you're using the simulated PLC server that was deployed with the Azure IoT Operations Quickstart, you don't need to change the `endpointUrl`. If you have your own OPC UA servers running or are using the simulated PLC servers deployed on Azure, add in your endpoint URL accordingly.
6565

@@ -77,13 +77,13 @@ To configure the custom OPC UA discovery handler with asset detection, first you
7777
```
7878

7979

80-
2. Apply the YAML to configure Azure Iot Akri to discover the assets:
80+
1. Apply the YAML to configure Azure Iot Akri to discover the assets:
8181

8282
```bash
8383
kubectl apply -f opcua-configuration.yaml -n azure-iot-operations
8484
```
8585

86-
3. To confirm that the asset discovery container is configured and started, check the pod logs with the following command:
86+
1. To confirm that the asset discovery container is configured and started, check the pod logs with the following command:
8787

8888
```bash
8989
kubectl logs <insert aio-akri-opcua-asset-discovery pod name> -n azure-iot-operations
@@ -143,13 +143,20 @@ To configure the custom OPC UA discovery handler with asset detection, first you
143143
144144
After the discovery is completed, the result is sent back to Azure IoT Akri to create an Akri instance custom resource with asset information and observable variables. The discovery handler repeats the discovery every 10 minutes to detect changes on the server.
145145
146-
4. To view the discovered Azure IoT Akri instances, run the following command:
146+
1. To view the discovered Azure IoT Akri instances, run the following command:
147147
148148
```bash
149149
kubectl get akrii -n azure-iot-operations
150150
```
151151
152-
Note that it may take a few minutes for the instance to show up.
152+
It might take a few minutes for the instance to show up.
153+
154+
The output from the previous command looks like the following example. You might need to wait for a few seconds for the Akri instance to be created:
155+
156+
```console
157+
NAMESPACE NAME CONFIG SHARED NODES AGE
158+
azure-iot-operations akri-opcua-asset-dbdef0 akri-opcua-asset true ["my-aio-vm"] 35m
159+
```
153160
154161
You can inspect the instance custom resource by using an editor such as OpenLens, under `CustomResources/akri.sh/Instance`.
155162
@@ -161,7 +168,22 @@ To configure the custom OPC UA discovery handler with asset detection, first you
161168
162169
The OPC UA Connector supervisor watches for new Azure IoT Akri instance custom resources of type `opc-ua-asset`, and generates the initial asset types and asset custom resources for them. You can modify asset custom resources to add settings such as extending publishing for more data points, or to add OPC UA Broker observability settings.
163170
171+
1. To confirm that the Akri instance properly connected to the OPC UA Broker, copy and paste the name of the Akri instance that was the output of the previous step, into the following command:
164172
173+
```bash
174+
kubectl get akrii <AKRI_INSTANCE_NAME> -n azure-iot-operations -o json
175+
```
176+
177+
The command output looks like the following example. This example output shows the Akri instance `brokerProperties` values and confirms that the OPC UA Broker is connected.
178+
179+
```json
180+
"spec": {
181+
182+
"brokerProperties": {
183+
"ApplicationUri": "Boiler #2",
184+
"AssetEndpointProfile": "{\"spec\":{\"uuid\":\"opc-ua-broker-opcplc-000000-azure-iot-operation\"……
185+
```
186+
165187
## Related content
166188
167189
- [Azure IoT Akri overview](overview-akri.md)

0 commit comments

Comments
 (0)