1 min read

Switch between AKS clusters quickly


Juggling AKS clusters

Get credentials for a cluster:

aks_creds.sh
az aks get-credentials --resource-group myRG --name myCluster

This merges the kubeconfig. Switch between contexts:

switch_context.sh
kubectl config get-contexts
kubectl config use-context myCluster

Use admin credentials (bypasses RBAC/AAD):

aks_admin.sh
az aks get-credentials --resource-group myRG --name myCluster --admin

Tip: Use kubectx for faster context switching: brew install kubectx