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/aks/workload-identity-deploy-cluster.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,23 +42,21 @@ az account set --subscription <subscription-id>
42
42
43
43
## Export environment variables
44
44
45
-
To help simplify steps to configure the identities required, the steps below define environment variables that are referenced in the examples in this article.
46
-
47
-
* Create these variables using the following commands. Replace the values shown with your own values.
# Include these variables to access key vault secrets from a pod in the cluster.
59
-
export KEYVAULT_NAME="keyvault-workload-id"
60
-
export KEYVAULT_SECRET_NAME="my-secret"
61
-
```
45
+
To help simplify steps to configure the identities required, the steps below define environment variables that are referenced in the examples in this article. Remember to replace the values shown with your own values:
# Include these variables to access key vault secrets from a pod in the cluster.
57
+
export KEYVAULT_NAME="keyvault-workload-id"
58
+
export KEYVAULT_SECRET_NAME="my-secret"
59
+
```
62
60
63
61
## Create a resource group
64
62
@@ -203,7 +201,7 @@ az identity federated-credential create \
203
201
204
202
## Deploy your application
205
203
206
-
When you deploy your application pods, the manifest should reference the service account created in the **Create Kubernetes service account** step. The following manifest shows how to reference the account, specifically _metadata\namespace_ and _spec\serviceAccountName_ properties. Make sure to specify an image for `<image>` and a container name for `<containerName>`:
204
+
When you deploy your application pods, the manifest should reference the service account created in the **Create Kubernetes service account** step. The following manifest shows how to reference the account, specifically the _metadata\namespace_ and _spec\serviceAccountName_ properties. Make sure to specify an image for `<image>` and a container name for `<containerName>`:
207
205
208
206
```yml
209
207
cat <<EOF | kubectl apply -f -
@@ -247,6 +245,7 @@ The following example shows how to use the Azure role-based access control (Azur
247
245
248
246
1. Assign yourself the RBAC [Key Vault Secrets Officer](../role-based-access-control/built-in-roles/security.md#key-vault-secrets-officer) role so that you can create a secret in the new key vault:
249
247
248
+
```azurecli-interactive
250
249
export KEYVAULT_RESOURCE_ID=$(az keyvault show --resource-group "${KEYVAULT_RESOURCE_GROUP}" \
251
250
--name "${KEYVAULT_NAME}" \
252
251
--query id \
@@ -255,6 +254,7 @@ The following example shows how to use the Azure role-based access control (Azur
255
254
az role assignment create --assignee "\<user-email\>" \
256
255
--role "Key Vault Secrets Officer" \
257
256
--scope "${KEYVAULT_RESOURCE_ID}"
257
+
```
258
258
259
259
1. Create a secret in the key vault:
260
260
@@ -267,7 +267,7 @@ The following example shows how to use the Azure role-based access control (Azur
267
267
--value "Hello\!"
268
268
```
269
269
270
-
1. Assign the [Key Vault Secrets User](../role-based-access-control/built-in-roles/security.md#key-vault-secrets-user) role to the user-assigned managed identity that you created previously. This step gives the managed identity the ability to read secrets from the key vault.
270
+
1. Assign the [Key Vault Secrets User](../role-based-access-control/built-in-roles/security.md#key-vault-secrets-user) role to the user-assigned managed identity that you created previously. This step gives the managed identity permission to read secrets from the key vault:
271
271
272
272
```azurecli-interactive
273
273
export IDENTITY_PRINCIPAL_ID=$(az identity show \
@@ -283,7 +283,7 @@ The following example shows how to use the Azure role-based access control (Azur
283
283
--assignee-principal-type ServicePrincipal
284
284
```
285
285
286
-
1. Export the key vault URL:
286
+
1. Create an environment variable for the key vault URL:
287
287
288
288
```azurecli-interactive
289
289
export KEYVAULT_URL="$(az keyvault show \
@@ -293,7 +293,7 @@ The following example shows how to use the Azure role-based access control (Azur
293
293
--output tsv)"
294
294
```
295
295
296
-
1. Deploy a pod that references the service account and key vault URL above:
296
+
1. Deploy a pod that references the service account and key vault URL:
0 commit comments