Skip to content

Commit c0a7cec

Browse files
Merge pull request #260840 from karok2m/kakostan/opc-ua
Fixed OPC UA Broker secret references.
2 parents f72fd6f + d446d8c commit c0a7cec

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

articles/iot-operations/manage-devices-assets/howto-configure-opcua-authentication-options.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,19 @@ The following table shows the feature support level for authentication in the cu
4242
## Configure OPC UA transport authentication
4343
OPC UA transport authentication requires you to configure the following items:
4444
- The OPC UA X.509 client transport certificate to be used for transport authentication and encryption. Currently, this certificate is an application certificate used for all transport in OPC UA Broker.
45-
- The private key to be used for the authentication and encryption. Currently, password protected private key files aren't supported.
45+
- The private key to be used for the authentication and encryption. Currently, password protected private key files aren't supported.
4646

47-
In Azure IoT Digital Operations Experience, the first step to set up an asset endpoint requires you to configure the thumbprint of the transport certificate. The following code examples reference the certificate file *./secret/cert.der*.
47+
In Azure IoT Digital Operations Experience, the first step to set up an asset endpoint requires you to configure the thumbprint of the transport certificate. The following code examples reference the certificate file *./secret/cert.der* and private key file *./secret/cert.pem*.
48+
49+
To create a sample self-signed certificate for transport authorization with *./secret/cert.der* and *./secret/cert.pem* files, see [Create a self-signed certificate for transport authorization](#create-a-self-signed-certificate-for-transport-authorization).
4850

4951
To complete the configuration of an asset endpoint in Operations Experience, do the following steps:
5052

51-
1. Configure the transport certificate and private key in Azure Key Vault. In the following example, the file *./secret/cert.der* contains the transport certificate and the file *./secret/cert.pem* contains the private key.
53+
1. Configure the transport certificate and private key in Azure Key Vault. In the following example, the file *./secret/cert.der* contains the transport certificate and the file *./secret/cert.pem* contains the private key.
54+
55+
To configure the transport certificate, run the following commands:
5256

53-
To configure the transport certificate, run the following commands:
5457

55-
5658
```bash
5759
# Upload cert.der Application certificate as secret to Azure Key Vault
5860
az keyvault secret set \
@@ -61,7 +63,7 @@ To complete the configuration of an asset endpoint in Operations Experience, do
6163
--file ./secret/cert.der \
6264
--encoding hex \
6365
--content-type application/pkix-cert
64-
66+
6567
# Upload cert.pem private key as secret to Azure Key Vault
6668
az keyvault secret set \
6769
--name "aio-opc-opcua-connector-pem" \
@@ -70,8 +72,8 @@ To complete the configuration of an asset endpoint in Operations Experience, do
7072
--encoding hex \
7173
--content-type application/x-pem-file
7274
```
73-
74-
1. Configure the secret provider class `aio-opc-ua-broker-client-certificate` custom resource (CR) in the connected cluster. Use a K8s client such as kubectl to configure the secrets `aio-opc-opcua-connector-der` and `aio-opc-opcua-connector-pem` in the SPC object array in the connected cluster.
75+
76+
2. Configure the secret provider class `aio-opc-ua-broker-client-certificate` custom resource (CR) in the connected cluster. Use a K8s client such as kubectl to configure the secrets `aio-opc-opcua-connector-der` and `aio-opc-opcua-connector-pem` in the SPC object array in the connected cluster.
7577

7678
The following example shows a complete SPC CR after you added the secret configurations:
7779

@@ -185,10 +187,18 @@ Before you can configure secrets for the username and password, you need to comp
185187
186188
```bash
187189
# Create username Secret in Azure Key Vault
188-
az keyvault secret set --name "username" --vault-name <azure-key-vault-name> --value "user1" --content-type "text/plain"
189-
190+
az keyvault secret set \
191+
--name "username" \
192+
--vault-name <azure-key-vault-name> \
193+
--value "user1" \
194+
--content-type "text/plain"
195+
190196
# Create password Secret in Azure Key Vault
191-
az keyvault secret set --name "password" --vault-name <azure-key-vault-name> --value "password" --content-type "text/plain"
197+
az keyvault secret set \
198+
--name "password" \
199+
--vault-name <azure-key-vault-name> \
200+
--value "password" \
201+
--content-type "text/plain"
192202
```
193203
194204
1. Configure the secret provider class `aio-opc-ua-broker-user-authentication` custom resource (CR) in the connected cluster. Use a K8s client such as kubectl to configure the secrets (`username` and `password`, in the following example) in the SPC object array in the connected cluster.

articles/iot-operations/manage-devices-assets/howto-manage-assets-remotely.md

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -78,34 +78,24 @@ When the OPC PLC simulator is running, data flows from the simulator, to the con
7878

7979
### Configure an asset endpoint to use a username and password
8080

81-
The previous example uses the `Anonymous` authentication mode. This mode doesn't require a username or password. If you want to use the `UsernamePassword` authentication mode, you must configure the asset endpoint accordingly.
81+
The previous example uses the `Anonymous` authentication mode. This mode doesn't require a username or password.
8282

83-
The following script shows how to create a secret for the username and password and add it to the Kubernetes store:
83+
To use the `UsernamePassword` authentication mode, complete the following steps:
8484

85-
```sh
86-
# NAMESPACE is the namespace containing the MQ broker.
87-
export NAMESPACE="azure-iot-operations"
88-
89-
# Set the desired username and password here.
90-
export USERNAME="username"
91-
export PASSWORD="password"
92-
93-
echo "Storing k8s username and password generic secret..."
94-
kubectl create secret generic opc-ua-connector-secrets --from-literal=username=$USERNAME --from-literal=password=$PASSWORD --namespace $NAMESPACE
95-
```
96-
97-
To configure the asset endpoint to use these secrets, select **Username & password** for the **User authentication** field. Then enter the following values for the **Username reference** and **Password reference** fields:
85+
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.
86+
2. In Azure IoT Operations portal, select **Username & password** for the **User authentication** field to configure the asset endpoint to use these secrets. Then enter the following values for the **Username reference** and **Password reference** fields:
9887

9988
| Field | Value |
10089
| --- | --- |
101-
| Username reference | `@@sec_k8s_opc-ua-connector-secrets/username` |
102-
| Password reference | `@@sec_k8s_opc-ua-connector-secrets/password` |
103-
104-
The following example YAML file shows the configuration for an asset endpoint that uses the `UsernamePassword` authentication mode. The configuration references the secret you created previously:
90+
| Username reference | `aio-opc-ua-broker-user-authentication/username` |
91+
| Password reference | `aio-opc-ua-broker-user-authentication/password` |
10592

10693
### Configure an asset endpoint to use a transport authentication certificate
10794

108-
To configure the asset endpoint to use a transport authentication certificate, select **Use transport authentication certificate** for the **Transport authentication** field. Then enter the certificate thumbprint and the certificate password reference.
95+
To configure the asset endpoint to use a transport authentication certificate, complete the following steps:
96+
97+
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.
98+
2. In Azure IoT Operations portal, select **Use transport authentication certificate** for the **Transport authentication** field and enter the certificate thumbprint.
10999

110100
## Add an asset, tags, and events
111101

0 commit comments

Comments
 (0)