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/update-credentials.md
+29-10Lines changed: 29 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,30 @@
1
1
---
2
2
title: Reset the credentials for an Azure Kubernetes Service (AKS) cluster
3
-
description: Learn how update or reset the service principal credentials for a cluster in Azure Kubernetes Service (AKS)
3
+
description: Learn how update or reset the service principal or AAD Application credentials for an Azure Kubernetes Service (AKS) cluster
4
4
services: container-service
5
5
ms.topic: article
6
-
ms.date: 05/31/2019
6
+
ms.date: 03/11/2019
7
7
8
8
---
9
9
10
-
# Update or rotate the credentials for a service principal in Azure Kubernetes Service (AKS)
10
+
# Update or rotate the credentials for Azure Kubernetes Service (AKS)
11
11
12
12
By default, AKS clusters are created with a service principal that has a one-year expiration time. As you near the expiration date, you can reset the credentials to extend the service principal for an additional period of time. You may also want to update, or rotate, the credentials as part of a defined security policy. This article details how to update these credentials for an AKS cluster.
13
13
14
+
You may also have [integrated your AKS cluster with Azure Active Directory][aad-integration], and use it as an authentication provider for your cluster. In that case you will have 2 more identities created for your cluster, the AAD Server App and the AAD Client App, you may also reset those credentials.
15
+
14
16
## Before you begin
15
17
16
18
You need the Azure CLI version 2.0.65 or later installed and configured. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI][install-azure-cli].
17
19
18
-
## Choose to update or create a service principal
20
+
## Update or create a new Service Principal for your AKS cluster
19
21
20
22
When you want to update the credentials for an AKS cluster, you can choose to:
21
23
22
24
* update the credentials for the existing service principal used by the cluster, or
23
25
* create a service principal and update the cluster to use these new credentials.
24
26
25
-
### Update Existing Service Principal Expiration
27
+
### Reset Existing Service Principal Credential
26
28
27
29
To update the credentials for the existing service principal, get the service principal ID of your cluster using the [az aks show][az-aks-show] command. The following example gets the ID for the cluster named *myAKSCluster* in the *myResourceGroup* resource group. The service principal ID is set as a variable named *SP_ID* for use in additional command.
28
30
@@ -37,11 +39,11 @@ With a variable set that contains the service principal ID, now reset the creden
Now continue on to [update AKS cluster with new credentials](#update-aks-cluster-with-new-credentials). This step is necessary for the Service Principal changes to reflect on the AKS cluster.
42
+
Now continue on to [update AKS cluster with new service principal credentials](#update-aks-cluster-with-new-service-principal-credentials). This step is necessary for the Service Principal changes to reflect on the AKS cluster.
41
43
42
44
### Create a New Service Principal
43
45
44
-
If you chose to update the existing service principal credentials in the previous section, skip this step. Continue to [update AKS cluster with new credentials](#update-aks-cluster-with-new-credentials).
46
+
If you chose to update the existing service principal credentials in the previous section, skip this step. Continue to [update AKS cluster with new service principal credentials](#update-aks-cluster-with-new-service-principal-credentials).
45
47
46
48
To create a service principal and then update the AKS cluster to use these new credentials, use the [az ad sp create-for-rbac][az-ad-sp-create] command. In the following example, the `--skip-assignment` parameter prevents any additional default assignments being assigned:
Now continue on to [update AKS cluster with new credentials](#update-aks-cluster-with-new-credentials). This step is necessary for the Service Principal changes to reflect on the AKS cluster.
72
+
Now continue on to [update AKS cluster with new service principal credentials](#update-aks-cluster-with-new-service-principal-credentials). This step is necessary for the Service Principal changes to reflect on the AKS cluster.
71
73
72
-
## Update AKS cluster with new credentials
74
+
## Update AKS cluster with new Service Principal credentials
73
75
74
76
Regardless of whether you chose to update the credentials for the existing service principal or create a service principal, you now update the AKS cluster with your new credentials using the [az aks update-credentials][az-aks-update-credentials] command. The variables for the *--service-principal* and *--client-secret* are used:
75
77
@@ -84,14 +86,31 @@ az aks update-credentials \
84
86
85
87
It takes a few moments for the service principal credentials to be updated in the AKS.
86
88
89
+
## Update AKS Cluster with new AAD Application credentials
90
+
91
+
You may create new AAD Server and Client applications by following the [AAD integration steps][create-aad-app]. Or reset your existing AAD Applications following the [same method as for service principal reset](#reset-existing-service-principal-credential). After that you just need to update your cluster AAD Application credentials using the same [az aks update-credentials][az-aks-update-credentials] command but using the *--reset-aad* variables.
In this article, the service principal for the AKS cluster itself was updated. For more information on how to manage identity for workloads within a cluster, see [Best practices for authentication and authorization in AKS][best-practices-identity].
106
+
In this article, the service principal for the AKS cluster itself and the AAD Integration Applications were updated. For more information on how to manage identity for workloads within a cluster, see [Best practices for authentication and authorization in AKS][best-practices-identity].
0 commit comments