question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

403 Error when creating AKS cluster.

See original GitHub issue

CLI version 2.0.62 with AKS-Preview extension (0.3.0)

Describe the bug I am able to create AKS cluster from portal, but cannot create it with CLI due to 403 error. Error states that I’m lacking ‘resourceGroups/write’ permission on linked scope ‘providers/Microsoft.ContainerService/managedClusters/azureuser’ in the same resource group.

The “azureuser” is unexpected and this is linux node ssh user, not a cluster name.

To Reproduce

  1. See additional context to setup user permissions
  2. Deploy cluster with CLI az aks create --resource-group rgname --name clustername --node-count 3 --kubernetes-version 1.12.7 --node-vm-size Standard_DS2_v2 --generate-ssh-keys
  3. I receive following error: The client '...' with object id '…’ has permission to perform action 'Microsoft.ContainerService/managedClusters/write' on scope '/subscriptions/…/resourceGroups/.../providers/Microsoft.ContainerService/managedClusters/clustername'; however, it does not have permission to perform action 'Microsoft.Resources/subscriptions/resourceGroups/write' on the linked scope(s) '/subscriptions/…/resourceGroups/.../providers/Microsoft.ContainerService/managedClusters/azureuser'.
  4. When I add extra parameter --admin-username azureuser2 error is following: The client '...' with object id '…’ has permission to perform action 'Microsoft.ContainerService/managedClusters/write' on scope '/subscriptions/…/resourceGroups/.../providers/Microsoft.ContainerService/managedClusters/clustername'; however, it does not have permission to perform action 'Microsoft.Resources/subscriptions/resourceGroups/write' on the linked scope(s) '/subscriptions/…/resourceGroups/.../providers/Microsoft.ContainerService/managedClusters/azureuser2'.

Expected behavior I believe CLI checks extra permissions that are not needed for deployment (portal deployment works). Probably there is formatting bug that substitutes --admin-username instead of --name somwhere in the code.

Environment summary Windows 10, 1803

Additional context My AAD user has custom role on RG where AKS is deployed.

  • Contributor permission to all resources in RG
  • No resourceGroup/write permission – to avoid changing RG properties, e.g. tags.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mgrabarzcommented, Feb 21, 2022

Please note, that issue was about incorrect cli parameter handling (–azure-username) not permissions 😃

0reactions
navba-MSFTcommented, Feb 22, 2022

@mgrabarz Thanks for your reply. We will now proceed with closure of this github issue. If you need any further assistance on this issue in future, please feel free to reopen this thread. We would be happy to help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Azure Digital Twins: Error 403 (Forbidden)
This article describes causes and resolution steps for receiving a 403 error from service requests to Azure Digital Twins.
Read more >
AKS AAD Pod Identity Throwing Forbidden (403)
So I am trying to integrate KeyVault with an existing AKS Cluster using AAD Pod Identity. I have closely followed the documentation for ......
Read more >
Code error 403 when trying to access Kubernetes cluster
You get this error because you're getting blocked by RBAC policies. Basically, RBAC policies set to restrict the resources you use and limits...
Read more >
Creating AKS cluster with Managed Identity to give it access to ...
I configured an AKS cluster to use a system-assigned managed identity ... Failure responding to request: StatusCode=403 -- Original Error: ...
Read more >
Cannot able to attach Built in User Role Creation to AKS ...
Provisioning the AKS cluster via Azure DevOps using Terraform code as an infra. ... responding to request: StatusCode=403 -- Original Error: autorest/azure: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found