Skip to content

Commit 274d7ff

Browse files
committed
Update manage secrets
1 parent 6511794 commit 274d7ff

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

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

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: kgremban
55
ms.author: kgremban
66
ms.subservice: orchestrator
77
ms.topic: how-to
8-
ms.date: 12/19/2023
8+
ms.date: 03/12/2024
99
ms.custom: ignite-2023, devx-track-azurecli
1010

1111
#CustomerIntent: As an IT professional, I want prepare an Azure-Arc enabled Kubernetes cluster with Key Vault secrets so that I can deploy Azure IoT Operations to it.
@@ -23,17 +23,17 @@ Secrets management in Azure IoT Operations Preview uses Azure Key Vault as the m
2323

2424
## Configure a secret store on your cluster
2525

26-
Azure IoT Operations supports Azure Key Vault for storing secrets and certificates. The `az iot ops init` Azure CLI command automates the steps to create a key vault, set up a service principal to give access to the key vault, and configure the secrets that you need for running Azure IoT Operations.
26+
Azure IoT Operations supports Key Vault for storing secrets and certificates. The `az iot ops init` Azure CLI command automates the steps to create a key vault, set up a service principal to give access to the key vault, and configure the secrets that you need for running Azure IoT Operations.
2727

2828
For more information, see [Deploy Azure IoT Operations Preview extensions to a Kubernetes cluster](../deploy-iot-ops/howto-deploy-iot-operations.md?tabs=cli).
2929

30-
## Configure service principal and Azure Key Vault upfront
30+
## Configure service principal and Key Vault manually
3131

3232
If the Azure account executing the `az iot ops init` command doesn't have permissions to query the Microsoft Graph and create service principals, you can prepare these upfront and use extra arguments when running the CLI command as described in [Deploy Azure IoT Operations extensions](./howto-deploy-iot-operations.md?tabs=cli).
3333

34-
### Configure service principal for interacting with Azure Key Vault via Microsoft Entra ID
34+
### Configure service principal for interacting with Key Vault via Microsoft Entra ID
3535

36-
Follow these steps to create a new Application Registration that will be used by the AIO application to authenticate to Key Vault.
36+
Follow these steps to create a new Application Registration for the Azure IoT Operations application to use to authenticate to Key Vault.
3737

3838
First, register an application with Microsoft Entra ID:
3939

@@ -71,7 +71,7 @@ Next, give your application permissions for key vault:
7171

7272
1. Select **Add permissions**.
7373

74-
Create a client secret that will be added to your Kubernetes cluster to authenticate to your key vault:
74+
Create a client secret that is added to your Kubernetes cluster to authenticate to your key vault:
7575

7676
1. On the resource page for your app, select **Certificates & secrets** from the **Manage** section of the app menu.
7777

@@ -83,11 +83,11 @@ Create a client secret that will be added to your Kubernetes cluster to authenti
8383

8484
Retrieve the service principal Object ID:
8585

86-
1. On the **Overview** page for your app, under the section **Essentials**, click on the **Application name** link under **Managed application in local directory**. This opens the Enterprise Application properties. Copy the Object ID to use when you run `az iot ops init`.
86+
1. On the **Overview** page for your app, under the **Essentials** section, select the **Application name** link under **Managed application in local directory**. This opens the Enterprise Application properties. Copy the Object ID to use when you run `az iot ops init`.
8787

88-
### Create an Azure Key Vault
88+
### Create a key vault
8989

90-
Create a new Azure Key Vault service and ensure it has the **Permission Model** set to Vault access policy.
90+
Create a new Azure Key Vault instance and ensure that it has the **Permission Model** set to **Vault access policy**.
9191

9292
```bash
9393
az keyvault create --enable-rbac-authorization false --name "<your unique key vault name>" --resource-group "<the name of the resource group>"
@@ -103,19 +103,24 @@ You'll need the Key Vault resource ID when you run `az iot ops init`. To retriev
103103
az keyvault show --name "<your unique key vault name>" --resource-group "<the name of the resource group>" --query id -o tsv
104104
```
105105

106-
### Set service principal access policy in Azure Key Vault
106+
### Set service principal access policy in Key Vault
107107

108108
The newly created service principal needs **Secret** `list` and `get` access policy for the Azure IoT Operations to work with the secret store.
109109

110+
To assign these permissions, the service principal logged in to the CLI needs an access policy with at least permissions to `get` secrets.
111+
112+
>[!TIP]
113+
>If you used the logged-in CLI principal to create the Key Vault, then you probably already have the right permissions. However, if you're pointing to a different or existing Key Vault then you should check that you have sufficient permissions to set access policies.
114+
110115
Run the following to assign **secret** `get` and `list` permissions to the service principal.
111116

112117
```bash
113-
az keyvault set-policy --name "<your unique key vault name>" --resource-group "<the name of the resource group>" --object-id <Object ID copied from Enterprise Application SP in Microsoft Entra ID> --secret-permissions get list --key-permissions get list
118+
az keyvault set-policy --name "<your unique key vault name>" --resource-group "<the name of the resource group>" --object-id <Object ID copied from Enterprise Application SP in Microsoft Entra ID> --secret-permissions get list
114119
```
115120

116121
### Pass service principal and Key Vault arguments to Azure IoT Operations deployment
117122

118-
When following the guide [Deploy Azure IoT Operations extensions](./howto-deploy-iot-operations.md?tabs=cli), you'll need to pass in additional flags to the `az iot ops init` command in order to use the pre-configured service principal and key vault.
123+
When following the guide [Deploy Azure IoT Operations extensions](./howto-deploy-iot-operations.md?tabs=cli), pass in additional flags to the `az iot ops init` command in order to use the preconfigured service principal and key vault.
119124

120125
The following example shows how to prepare the cluster for Azure IoT Operations without fully deploying it by using `--no-deploy` flag. You can also run the command without this argument for a default Azure IoT Operations deployment.
121126

@@ -128,9 +133,12 @@ az iot ops init --name "<your unique key vault name>" --resource-group "<the nam
128133
--no-deploy
129134
```
130135

136+
>[!TIP]
137+
>If the service principal logged in to the CLI has secret `set` permissions, then the `init` command can create the secret in Key Vault on your behalf if it doesn't already exist.
138+
131139
## Add a secret to an Azure IoT Operations component
132140

133-
Once you have the secret store set up on your cluster, you can create and add Azure Key Vault secrets.
141+
Once you have the secret store set up on your cluster, you can create and add Key Vault secrets.
134142

135143
1. Create your secret in Key Vault with whatever name and value you need. You can create a secret by using the [Azure portal](https://portal.azure.com) or the [az keyvault secret set](/cli/azure/keyvault/secret#az-keyvault-secret-set) command.
136144

@@ -167,4 +175,4 @@ kubectl delete pod aio-dp-runner-worker-0 -n azure-iot-operations
167175

168176
## Azure IoT MQ Preview secrets
169177

170-
The steps to manage secrets with Azure Key Vault for Azure IoT MQ Preview are different. For more information, see [Manage Azure IoT MQ secrets using Azure Key Vault](../manage-mqtt-connectivity/howto-manage-secrets.md).
178+
The steps to manage secrets with Azure Key Vault for Azure IoT MQ Preview are different. For more information, see [Manage MQ secrets using Key Vault](../manage-mqtt-connectivity/howto-manage-secrets.md).

0 commit comments

Comments
 (0)