The error message indicates that the Azure user associated with your Azure CLI session (the user represented by "xxxxxxxxxxxxxxxxxxxxxxx") does not have the necessary permissions to list resources of type "nodes" in the Kubernetes cluster.
To resolve this issue, you need to ensure that the Azure user has the appropriate RBAC (Role-Based Access Control) permissions in the AKS (Azure Kubernetes Service) cluster. Here are the steps to grant the necessary permissions:
- Check RBAC Role Assignment: Verify the RBAC role assignment for your Azure user in the AKS cluster. You need to ensure that the user has the appropriate role (e.g.,
Azure Kubernetes Service Cluster User
) assigned to the AKS resource.
az role assignment list --resource-group <yourResourceGroup> --assignee <userObjectId>
Replace <yourResourceGroup> with the name of your AKS resource group, and <userObjectId> with the Object ID of your Azure user.
- Assign RBAC Role: If the user does not have the necessary role assignment, assign the Azure Kubernetes Service Cluster User role to the user:
az role assignment create --role "Azure Kubernetes Service Cluster User" --assignee <userObjectId> --scope <aksResourceID>
Replace <userObjectId> with the Object ID of your Azure user, and <aksResourceID> with the full resource ID of your AKS cluster (e.g., /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.ContainerService/managedClusters/{aksClusterName}).
- Wait for Propagation: It may take a few minutes for the role assignment to propagate. After making the assignment, wait for a short period before attempting to access the AKS cluster again.
hth Marcin