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/get-started/quickstart-add-assets.md
+6-38Lines changed: 6 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,8 @@ Complete [Quickstart: Deploy Azure IoT Operations Preview to an Arc-enabled Kube
29
29
30
30
To sign in to the Azure IoT Operations portal, you need a work or school account in the tenant where you deployed Azure IoT Operations. If you're currently using a Microsoft account (MSA), you need to create a Microsoft Entra ID with at least contributor permissions for the resource group that contains your **Kubernetes - Azure Arc** instance. To learn more, see [Known Issues > Create Entra account](../troubleshoot/known-issues.md#azure-iot-operations-preview-portal).
31
31
32
+
For this quickstart, we use the **OPC PLC simulator** as our OPC UA Server endpoint. Follow [How to configure an OPC PLC simulator to work with Azure IoT OPC UA Broker](../manage-devices-assets/howto-configure-opc-plc-simulator.md) to make sure that OPC PLC is properly installed and configured before you begin.
33
+
32
34
## What problem will we solve?
33
35
34
36
The data that OPC UA servers expose can have a complex structure and can be difficult to understand. Azure IoT Operations provides a way to model OPC UA assets as tags, events, and properties. This modeling makes it easier to understand the data and to use it in downstream processes such as the MQ broker and Azure IoT Data Processor Preview pipelines.
@@ -84,40 +86,6 @@ To add an asset endpoint:
84
86
85
87
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.
86
88
87
-
The following step lowers the security level for the OPC PLC so that it accepts connections from any client without an explicit peer certificate trust operation. To enable the asset endpoint to use an untrusted certificate:
88
-
89
-
> [!CAUTION]
90
-
> Don't use untrusted certificates in production environments. To learn more, see [Configure an OPC PLC simulator](../manage-devices-assets/howto-configure-opc-plc-simulator.md).
91
-
92
-
1. Run the following command to enable the use of an untrusted certificate. Replace the two placeholders with your cluster name and resource group name:
1. To enable the configuration change to take effect immediately, first find the name of your `aio-opc-supervisor` pod by using the following command:
108
-
109
-
```console
110
-
kubectl get pods -n azure-iot-operations
111
-
```
112
-
113
-
The name of your pod looks like `aio-opc-supervisor-956fbb649-k9ppr`.
114
-
115
-
1. Restart the `aio-opc-supervisor` pod by using a command that looks like the following example. Use the `aio-opc-supervisor` pod name from the previous step:
116
-
117
-
```console
118
-
kubectl delete pod aio-opc-supervisor-956fbb649-k9ppr -n azure-iot-operations
119
-
```
120
-
121
89
## Manage your assets
122
90
123
91
After you select your cluster in Azure IoT Operations portal, you see the available list of assets on the **Assets** page. If there are no assets yet, this list is empty:
@@ -204,7 +172,7 @@ The sample tags you added in the previous quickstart generate messages from your
204
172
205
173
```json
206
174
{
207
-
"Timestamp": "2024-03-08T00:54:58.6572007Z",
175
+
"Timestamp": "2024-03-08T00:54:58.6572007Z",
208
176
"MessageType": "ua-deltaframe",
209
177
"payload": {
210
178
"temperature": {
@@ -261,7 +229,7 @@ kubectl get akrii -n azure-iot-operations
261
229
262
230
It might take a few minutes for the instance to show up.
263
231
264
-
The output from the previous command looks like the following example.
232
+
The output from the previous command looks like the following example.
Copy file name to clipboardExpand all lines: articles/iot-operations/manage-devices-assets/howto-configure-opc-plc-simulator.md
+56-25Lines changed: 56 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,9 @@ Azure IoT Operations installed. For more information, see [Quickstart: Deploy Az
22
22
23
23
## Deploy the OPC PLC simulator
24
24
25
-
This section shows how to deploy the OPC PLC simulator.
25
+
This section shows how to deploy the OPC PLC simulator.
26
+
27
+
The following step lowers the security level for the OPC PLC so that it accepts connections from AzureIot OPC UA Broker or any client without an explicit peer certificate trust operation.
26
28
27
29
> [!IMPORTANT]
28
30
> Don't use the following example in production, use it for simulation and test purposes only. The example lowers the security level for the OPC PLC so that it accepts connections from any client without an explicit peer certificate trust operation.
@@ -44,27 +46,51 @@ az k8s-extension update \
44
46
45
47
The OPC PLC OPC UA server should run in the same deployment as a separate pod.
46
48
47
-
## Get the certificate of the OPC PLC simulator
48
-
The application instance certificate of the OPC PLC is a self-signed certificate managed by cert-manager and stored in the `secret aio-opc-ua-opcplc-default-application-cert-000000` kubernetes secret.
49
-
50
-
To get the certificate, run the following commands on your cluster:
51
-
52
-
```bash
53
-
# extract the public key of the opc plc from the kubernetes secret
# optionally transform the certificate in *.der format
57
-
openssl x509 -outform der -in opcplc.crt -out opcplc.der
58
-
```
59
-
60
-
## Configure OPC UA mutual trust
61
-
The next step in OPC UA authentication is to configure mutual trust. In OPC UA communication, the OPC UA client and server authenticate each other.
62
-
63
-
To complete this configuration, follow the steps to [configure mutual trust](howto-configure-opcua-certificates-infrastructure.md#how-to-handle-the-opc-ua-trusted-certificates-list). Use the certificate file you extracted in the previous section.
49
+
## Configure OPC UA mutual trust between Azure Iot OPC UA Broker Preview and the OPC PLC
64
50
65
-
For simplicity, on the OPC PLC you don't need to do a mutual trust action. Mutual trust is configured with `autoAcceptUntrustedCertificates`, which accepts connections from any OPC UA client.
51
+
The application instance certificate of the OPC PLC is a self-signed certificate managed by cert-manager and stored in the `secret aio-opc-ua-opcplc-default-application-cert-000000` kubernetes secret.
66
52
67
-
## Optionally configure for no authentication
53
+
1. Get the certificate, run the following commands on your cluster, and push it to Azure Key Vault.
54
+
55
+
```bash
56
+
kubectl -n azure-iot-operations get secret aio-opc-ua-opcplc-default-application-cert-000000 -o jsonpath='{.data.tls\.crt}'| \
57
+
xargs -I {} \
58
+
az keyvault secret set \
59
+
--name "opcplc-crt" \
60
+
--vault-name <azure-key-vault-name> \
61
+
--value {} \
62
+
--encoding base64 \
63
+
--content-type application/x-pem-file
64
+
```
65
+
66
+
2. Configure the secret provider class (SPC) `aio-opc-ua-broker-trust-list` custom resource (CR) in the connected cluster. Use a K8s client such as kubectl to configure the secret `opcplc.crt`in the SPC object array in the connected cluster.
67
+
68
+
```yml
69
+
apiVersion: secrets-store.csi.x-k8s.io/v1
70
+
kind: SecretProviderClass
71
+
metadata:
72
+
name: aio-opc-ua-broker-trust-list
73
+
namespace: azure-iot-operations
74
+
spec:
75
+
provider: azure
76
+
parameters:
77
+
usePodIdentity: 'false'
78
+
keyvaultName: <azure-key-vault-name>
79
+
tenantId: <azure-tenant-id>
80
+
objects: |
81
+
array:
82
+
- |
83
+
objectName: opcplc-crt
84
+
objectType: secret
85
+
objectAlias: opcplc.crt
86
+
objectEncoding: hex
87
+
```
88
+
89
+
The projection of the Azure Key Vault secrets and certificates into the cluster takes some time depending on the configured polling interval.
90
+
91
+
Now, the Azure IoT OPC UA Broker the trust relationship with OPC PLC should be established and you can proceed to create an `Asset Endpoint Profile` to connect to your OPC PLC simulation server.
92
+
93
+
## Optionally configure your `Asset Endpoint Profile` without mutual trust established
68
94
69
95
You can optionally configure an asset endpoint profile for the OPC PLC to run without mutual trust established. If you understand the risks, you can turn off authentication for testing purposes.
70
96
@@ -73,14 +99,19 @@ You can optionally configure an asset endpoint profile for the OPC PLC to run wi
73
99
74
100
To allow your asset endpoint profile to connect to any OPC PLC server without establishing mutual trust, use the `additionalConfiguration` setting to change the `AssetEndpointProfile` for OPC UA.
75
101
76
-
Configure the setting as shown in the following example JSON code:
102
+
Patch the asset endpoint with `autoAcceptUntrustedServerCertificates=true`:
0 commit comments