When I run az aks get-credentials --name project --resource-group project-rg
, I get the following error:
but I have owner access level in the resource group:
I’ve tried 1. logging out and logging in. 2. az account set --subscription guid2
. 3. checked if I have the right permissions (checked Microsoft.ContainerService/managedClusters/listClusterAdminCredential/action
Neither has worked. Any suggestions?
Solution- turns out I didn’t run the az account set --subscription <guid>
2
Answers
...Turns out I needed to set the cluster subscription using
az account set --subscription <guid>
You would need the specific permission at the cluster level to be able to run the get-credentials command.
The permission is:
Microsoft.ContainerService/managedCluster/listClusterUserCredential/action
This permission is usually included in the following default roles:
If you give yourself one of these permissions, you should be authorised to run the get-credentials command.