Azure Kubernetes Error when running "az aks get-credentials --resource-group AKSResourceGroupName --name AKSClusterName" command

12/28/2021

I am getting this error(ResourceGroupNotFound) while running this command <az aks get-credentials --resource-group AKSResourceGroupName --name AKSClusterName>

Error message :-

az aks get-credentials --resource-group AKSResourceGroupName --name AKSClusterName (ResourceGroupNotFound) Resource group 'AKSResourceGroupName' could not be found. Code: ResourceGroupNotFound Message: Resource group 'AKSResourceGroupName' could not be found.

-- user17784455
azure
kubernetes

2 Answers

12/29/2021

az aks get-credentials command is used to Get access credentials for a managed Kubernetes cluster.

Example:

az aks get-credentials --name MyManagedCluster --resource-group MyResourceGroup

name and resource-group are required parameters where you should provide Name of your managed cluster and Name of your resource group.

-- RajkumarMamidiChettu-MT
Source: StackOverflow

12/29/2021

First, please check your subscription and select correct subscription:

az account list --output table    
az account set --subscription <name or id>

then you doing everything correct:

az aks get-credentials --name AKSClusterName --resource-group AKSResourceGroupName
-- nobodyfromhell
Source: StackOverflow