Skip to content

Commit d87ef64

Browse files
Merge pull request #311129 from dominicbetts/aio-cert-clarification
AIO: Clarify cert formats and encodings
2 parents 9773ad6 + a81634f commit d87ef64

2 files changed

Lines changed: 53 additions & 1 deletion

File tree

articles/iot-operations/secure-iot-ops/howto-manage-certificates.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,30 @@ You can delete synced certificates as well. When you delete a synced certificate
208208
The previous sections explained how to manage certificates using the operations experience web UI and the Azure portal. You can also use the Azure CLI to manage the certificates in the connector for OPC UA trust and issuer lists. For more information, see [az iot ops connector opcua trust](/cli/azure/iot/ops/connector/opcua/trust) and [az iot ops connector opcua issuer](/cli/azure/iot/ops/connector/opcua/issuer) commands.
209209

210210
> [!TIP]
211-
> Remember, these certificates must be stored as secrets in Azure Key Vault.
211+
> Remember, these certificates must be stored as secrets in Azure Key Vault.
212+
213+
## Add certificates as secrets to Azure Key Vault
214+
215+
If you use the operations experience to select existing certificates that were previously added to Azure Key Vault, make sure that the secrets are in a format and encoding that's supported by Azure IoT Operations.
216+
217+
To add a PEM certificate secret to Azure Key Vault, you can use a command like the following example:
218+
219+
```azcli
220+
az keyvault secret set \
221+
--vault-name <your-key-vault-name> \
222+
--name my-cert-pem \
223+
--file ./my-cert.pem \
224+
--encoding hex \
225+
--content-type 'application/x-pem-file'
226+
```
227+
228+
To add a binary DER certificate secret to Azure Key Vault, you can use a command like the following example:
229+
230+
```azcli
231+
az keyvault secret set \
232+
--vault-name <your-key-vault-name> \
233+
--name my-cert-der \
234+
--file ./my-cert.der \
235+
--encoding hex \
236+
--content-type 'application/pkix-cert'
237+
```

articles/iot-operations/secure-iot-ops/howto-manage-secrets.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,29 @@ The previous sections explained how to manage secrets using the operations exper
7777
1. Use `kubectl` to create an `AKVSync` custom resource to configure the synchronization of a secret from Azure Key Vault to the Kubernetes cluster.
7878

7979
1. Use `az iot ops ns device endpoint inbound add` to configure an endpoint that references the synced secrets.
80+
81+
## Add secrets to Azure Key Vault
82+
83+
If you use the operations experience to select existing secrets that were previously added to Azure Key Vault, make sure that the secrets are in a format and encoding that's supported by Azure IoT Operations.
84+
85+
To add a PEM certificate secret to Azure Key Vault, you can use a command like the following example:
86+
87+
```azcli
88+
az keyvault secret set \
89+
--vault-name <your-key-vault-name> \
90+
--name client-cert-pem \
91+
--file ./client-cert.pem \
92+
--encoding hex \
93+
--content-type 'application/x-pem-file'
94+
```
95+
96+
To add a binary DER certificate secret to Azure Key Vault, you can use a command like the following example:
97+
98+
```azcli
99+
az keyvault secret set \
100+
--vault-name <your-key-vault-name> \
101+
--name cert-file-der \
102+
--file ./cert-file.der \
103+
--encoding hex \
104+
--content-type 'application/pkix-cert'
105+
```

0 commit comments

Comments
 (0)