kubernetes – Is it possible to use the Azure CLI command `az aks get-credentials` without changing the current context for `kubectl`?

Is it possible to run an Azure CLI command like:

az aks get-credentials --overwrite-existing --name test-aks-cluster --resource-group test-resource-group

without changing the current context that kubectl will use?

When running scripts, I often want to ensure that the credentials are current, but I don’t want to change the context, since other things might be currently running. Instead, I will often just specify the --context argument on the kubectl command, but I would really prefer that az not mess around with the current context at all.

Read more here: Source link