Verify existing contexts:
k config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
existing-demo-context existing-demo-cluster existing-demo-user default
Retrieving AKS cluster and overwrite existing one:
az aks get-credentials \
--resource-group rg-aks-demo \
--name aks-demo-cluster \
--overwrite-existing
The behavior of this command has been altered by the following extension: aks-preview
Merged "aks-demo-cluster" as current context in /home/demo-user/.kube/config
Context listing shows the new context:
k config get-contexts
k get po
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* aks-demo-cluster aks-demo-cluster clusterUser_rg-aks-demo_aks-demo-cluster
existing-demo-context existing-demo-cluster existing-demo-user default
No resources found in default namespace.