Hi,
In this article, I will show you how you can update the service principals of your AKS cluster.
Check the expiration of your service principal:
SP_ID=$(az aks show --resource-group myResourceGroup --name myAKSCluster \ --query servicePrincipalProfile.clientId -o tsv) az ad sp credential list --id "$SP_ID" --query "[].endDate" -o tsv
Update the service principal:
az aks update-credentials \
--resource-group myResourceGroup \
--name myAKSCluster \
--reset-service-principal \
--service-principal $SP_ID \
--client-secret $SP_SECRET
Update the AKS cluster with the new AAD Application credentials:
az aks update-credentials \ --resource-group myResourceGroup \ --name myAKSCluster \ --reset-aad \ --aad-server-app-id \ --aad-server-app-secret \ --aad-client-app-id
Maxime.