EMC
EMC

Reputation: 47

Azure CLI authorization failed when running locally

I'm trying to create a resource group and then deploy a Cosmos DB account using the Azure CLI installed on Ubuntu 20.

I keep getting an authorisation failed error (The client XXXX with object id XXXX does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/read' over scope.....)

Similar error when I try to create service principal with RBAC

I'm an Owner on the subscription, and it works with no problem in the cloud shell.

I logged in with az login

enter image description here

Upvotes: 1

Views: 1374

Answers (1)

RKM
RKM

Reputation: 1389

The The client XXXX with object id XXXX does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/read' over scope.....) error is because you do not have access to read the resource group which is due to role issue.

So, either give contributor role which has privilege to manage all resources or Cosmos DB Account Reader Role which has Privilege to get or list resource group.

enter image description here

enter image description here

But to assign any role, you need to have user administrator or owner role.

enter image description here

Reference- role-based-access-control-built-in-roles.

Upvotes: 0

Related Questions