Azure-Samples/virtual-machines-python-manage

Authorization Issue

Closed this issue · 7 comments

Hi,

Im getting below issue. Please assist on the same.
image

As the message says, the credentials you use does not the necessary RBAC (Role-Based Access Control) to do the action you want. Either change your credentials, or add the necessary RBAC to this account.

A list of the default RBAC can be found here :https://docs.microsoft.com/en-us/azure/active-directory/role-based-access-built-in-roles. As you can see the set of roles "Virtual Machine Contributor" solves your problem.

To add RBAC, you can use the Portal, PS, the XplatCLI or the Python CLI. This is the example with the XplatCLI:
https://docs.microsoft.com/en-us/azure/active-directory/role-based-access-control-manage-access-azure-cli

Hi @lmazuel I managed to add the below role to the resource groups and subscription.
image

But still i'm getting same error. I have followed below link to register a new app.
https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal

hi, in older portal, I coudn't find an option to select IAM roles.

The user is have MFA enabled. Could it be a reason for the error. ?

Hi @jk1510karti
Sorry for the late answer, I lost somehow the notification :(
This is not a message about MFA. However, using MFA you need to use ADAL and our wrapper.

Hi @lmazuel thanks for your response, I managed to solve this issue.