Skip to content

Commit f9418f0

Browse files
authored
Merge pull request #230853 from MGoedtel/task55254b
Refresh Workload Identity content
2 parents 49b6dec + 8c65171 commit f9418f0

File tree

3 files changed

+42
-39
lines changed

3 files changed

+42
-39
lines changed

articles/aks/workload-identity-deploy-cluster.md

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Deploy and configure an Azure Kubernetes Service (AKS) cluster with workl
33
description: In this Azure Kubernetes Service (AKS) article, you deploy an Azure Kubernetes Service cluster and configure it with an Azure AD workload identity (preview).
44
ms.topic: article
55
ms.custom: devx-track-azurecli
6-
ms.date: 01/11/2023
6+
ms.date: 03/14/2023
77
---
88

99
# Deploy and configure workload identity (preview) on an Azure Kubernetes Service (AKS) cluster
@@ -66,7 +66,7 @@ Create an AKS cluster using the [az aks create][az-aks-create] command with the
6666
```azurecli-interactive
6767
az group create --name myResourceGroup --location eastus
6868
69-
az aks create -g myResourceGroup -n myAKSCluster --node-count 1 --enable-oidc-issuer --enable-workload-identity --generate-ssh-keys
69+
az aks create -g myResourceGroup -n myAKSCluster --enable-oidc-issuer --enable-workload-identity
7070
```
7171

7272
After a few minutes, the command completes and returns JSON-formatted information about the cluster.
@@ -80,38 +80,18 @@ To get the OIDC Issuer URL and save it to an environmental variable, run the fol
8080
export AKS_OIDC_ISSUER="$(az aks show -n myAKSCluster -g myResourceGroup --query "oidcIssuerProfile.issuerUrl" -otsv)"
8181
```
8282

83-
## Create a managed identity and grant permissions to access Azure Key Vault
83+
## Create a managed identity
8484

85-
This step is necessary if you need to access secrets, keys, and certificates that are mounted in Azure Key Vault from a pod. Perform the following steps to configure access with a managed identity. These steps assume you have an Azure Key Vault already created and configured in your subscription. If you don't have one, see [Create an Azure Key Vault using the Azure CLI][create-key-vault-azure-cli].
86-
87-
Before proceeding, you need the following information:
88-
89-
* Name of the Key Vault
90-
* Resource group holding the Key Vault
85+
Use the Azure CLI [az account set][az-account-set] command to set a specific subscription to be the current active subscription. Then use the [az identity create][az-identity-create] command to create a managed identity.
9186

92-
You can retrieve this information using the Azure CLI command: [az keyvault list][az-keyvault-list].
93-
94-
1. Use the Azure CLI [az account set][az-account-set] command to set a specific subscription to be the current active subscription. Then use the [az identity create][az-identity-create] command to create a managed identity.
95-
96-
```azurecli
97-
export SUBSCRIPTION_ID="$(az account show --query id --output tsv)"
98-
export USER_ASSIGNED_IDENTITY_NAME="myIdentity"
99-
export RG_NAME="myResourceGroup"
100-
export LOCATION="eastus"
101-
102-
az identity create --name "${USER_ASSIGNED_IDENTITY_NAME}" --resource-group "${RG_NAME}" --location "${LOCATION}" --subscription "${SUBSCRIPTION_ID}"
103-
```
104-
105-
2. Set an access policy for the managed identity to access secrets in your Key Vault by running the following commands:
106-
107-
```azurecli
108-
export RG_NAME="myResourceGroup"
109-
export USER_ASSIGNED_IDENTITY_NAME="myIdentity"
110-
export KEYVAULT_NAME="myKeyVault"
111-
export USER_ASSIGNED_CLIENT_ID="$(az identity show --resource-group "${RG_NAME}" --name "${USER_ASSIGNED_IDENTITY_NAME}" --query 'clientId' -otsv)"
87+
```azurecli
88+
export SUBSCRIPTION_ID="$(az account show --query id --output tsv)"
89+
export USER_ASSIGNED_IDENTITY_NAME="myIdentity"
90+
export RG_NAME="myResourceGroup"
91+
export LOCATION="eastus"
11292
113-
az keyvault set-policy --name "${KEYVAULT_NAME}" --secret-permissions get --spn "${USER_ASSIGNED_CLIENT_ID}"
114-
```
93+
az identity create --name "${USER_ASSIGNED_IDENTITY_NAME}" --resource-group "${RG_NAME}" --location "${LOCATION}" --subscription "${SUBSCRIPTION_ID}"
94+
```
11595

11696
## Create Kubernetes service account
11797

@@ -166,6 +146,28 @@ az identity federated-credential create --name myfederatedIdentity --identity-na
166146
kubectl apply -f <your application>
167147
```
168148

149+
## Optional - Grant permissions to access Azure Key Vault
150+
151+
This step is necessary if you need to access secrets, keys, and certificates that are mounted in Azure Key Vault from a pod. Perform the following steps to configure access with a managed identity. These steps assume you have an Azure Key Vault already created and configured in your subscription. If you don't have one, see [Create an Azure Key Vault using the Azure CLI][create-key-vault-azure-cli].
152+
153+
Before proceeding, you need the following information:
154+
155+
* Name of the Key Vault
156+
* Resource group holding the Key Vault
157+
158+
You can retrieve this information using the Azure CLI command: [az keyvault list][az-keyvault-list].
159+
160+
1. Set an access policy for the managed identity to access secrets in your Key Vault by running the following commands:
161+
162+
```azurecli
163+
export RG_NAME="myResourceGroup"
164+
export USER_ASSIGNED_IDENTITY_NAME="myIdentity"
165+
export KEYVAULT_NAME="myKeyVault"
166+
export USER_ASSIGNED_CLIENT_ID="$(az identity show --resource-group "${RG_NAME}" --name "${USER_ASSIGNED_IDENTITY_NAME}" --query 'clientId' -otsv)"
167+
168+
az keyvault set-policy --name "${KEYVAULT_NAME}" --secret-permissions get --spn "${USER_ASSIGNED_CLIENT_ID}"
169+
```
170+
169171
## Disable workload identity
170172
171173
To disable the Azure AD workload identity on the AKS cluster where it's been enabled and configured, you can run the following command:

articles/aks/workload-identity-migrate-from-pod-identity.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: Modernize your Azure Kubernetes Service (AKS) application to use workload identity (preview)
2+
title: Migrate your Azure Kubernetes Service (AKS) pod to use workload identity (preview)
33
description: In this Azure Kubernetes Service (AKS) article, you learn how to configure your Azure Kubernetes Service pod to authenticate with workload identity.
44
ms.topic: article
55
ms.custom: devx-track-azurecli
6-
ms.date: 02/08/2023
6+
ms.date: 03/14/2023
77
---
88

9-
# Modernize application authentication with workload identity (preview)
9+
# Migrate from pod managed-identity to workload identity (preview)
1010

11-
This article focuses on pod-managed identity migration to Azure Active Directory (Azure AD) workload identity (preview) for your Azure Kubernetes Service (AKS) cluster. It also provides guidance depending on the version of the [Azure Identity][azure-identity-supported-versions] client library used by your container-based application.
11+
This article focuses on migrating from a pod-managed identity to Azure Active Directory (Azure AD) workload identity (preview) for your Azure Kubernetes Service (AKS) cluster. It also provides guidance depending on the version of the [Azure Identity][azure-identity-supported-versions] client library used by your container-based application.
1212

1313
[!INCLUDE [preview features callout](./includes/preview/preview-callout.md)]
1414

@@ -30,10 +30,10 @@ For either scenario, you need to have the federated trust set up before you upda
3030

3131
If your cluster is already using the latest version of the Azure Identity SDK, perform the following steps to complete the authentication configuration:
3232

33-
- Deploy workload identity in parallel to where the trust is setup. You can restart your application deployment to begin using the workload identity, where it injects the OIDC annotations into the application automatically.
33+
- Deploy workload identity in parallel with pod-managed identity. You can restart your application deployment to begin using the workload identity, where it injects the OIDC annotations into the application automatically.
3434
- After verifying the application is able to authenticate successfully, you can [remove the pod-managed identity](#remove-pod-managed-identity) annotations from your application and then remove the pod-managed identity add-on.
3535

36-
## Migrate from older version
36+
### Migrate from older version
3737

3838
If your cluster isn't using the latest version of the Azure Identity SDK, you have two options:
3939

@@ -65,7 +65,7 @@ If you don't have a managed identity created and assigned to your pod, perform t
6565
export USER_ASSIGNED_CLIENT_ID="$(az identity show --resource-group "resourceGroupName" --name "userAssignedIdentityName" --query 'clientId' -otsv)"
6666
```
6767
68-
2. Grant the managed identity the permissions required to access the resources in Azure it requires.
68+
2. Grant the managed identity the permissions required to access the resources in Azure it requires. For information on how to do this, see [Assign a managed identity access to a resource][assign-rbac-managed-identity].
6969
7070
3. To get the OIDC Issuer URL and save it to an environmental variable, run the following command. Replace the default values for the cluster name and the resource group name.
7171
@@ -208,6 +208,7 @@ This article showed you how to set up your pod to authenticate using a workload
208208
[azure-identity-libraries]: ../active-directory/develop/reference-v2-libraries.md
209209
[openid-connect-overview]: ../active-directory/develop/v2-protocols-oidc.md
210210
[install-azure-cli]: /cli/azure/install-azure-cli
211+
[assign-rbac-managed-identity]: ../active-directory/managed-identities-azure-resources/howto-assign-access-cli.md
211212

212213
<!-- EXTERNAL LINKS -->
213214
[kubectl-describe]: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#describe

articles/aks/workload-identity-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Use an Azure AD workload identities (preview) on Azure Kubernetes Service (AKS)
33
description: Learn about Azure Active Directory workload identity (preview) for Azure Kubernetes Service (AKS) and how to migrate your application to authenticate using this identity.
44
ms.topic: article
5-
ms.date: 01/06/2023
5+
ms.date: 03/14/2023
66

77
---
88

0 commit comments

Comments
 (0)