Azure-Samples / virtual-machines-python-manage

An example illustrating how to use Python to manage your Azure Virtual Machines
MIT License
104 stars 84 forks source link

Authorization Issue #4

Closed jk1510karti closed 7 years ago

jk1510karti commented 7 years ago

Hi,

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

lmazuel commented 7 years ago

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

jk1510karti commented 7 years ago

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

Offbeatmammal commented 7 years ago

Have you tried using the old (manage.windowsazure.com) portal? I had similar issue recently and old portal worked when new didn't

On Dec 22, 2016 9:49 PM, "jk1510karti" notifications@github.com wrote:

Hi @lmazuel https://github.com/lmazuel I managed to add the below role to the resource groups and subscription. [image: image] https://cloud.githubusercontent.com/assets/13429665/21447839/eb8a393a-c900-11e6-87d2-1f581aac2fbb.png

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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Azure-Samples/virtual-machines-python-manage/issues/4#issuecomment-268943870, or mute the thread https://github.com/notifications/unsubscribe-auth/AApW2m_Did3-GsbbqB1lQJ67DbSlkNczks5rK2DKgaJpZM4LUBEa .

jk1510karti commented 7 years ago

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

jk1510karti commented 7 years ago

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

lmazuel commented 7 years ago

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.

jk1510karti commented 7 years ago

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