COMMAND
az aks get-credentials --resource-group <rg-name> --name <aks-cluster-name>
ERROR
A different object named <aks-cluster-name> already exists in your kubeconfig file.
SOLUTION
Add the --overwrite-existing
flag to the command as presented in the example bellow:
az aks get-credentials --resource-group <rg-name> --name <aks-cluster-name> --overwrite-existing
After that you will be able to use the get-credentials command without any prompt. Very useful when you are automating routines.