Help with azurerm_role_assignment

Hello everyone,

I need help with azurerm_role_assignment

I have created storage account and I have to assign role to virtual machine.

In Azure console the steps are as follows

  1. Go to Access Control(IAM) in storage account

  2. Click on Add Role assignment

  3. Select role

  4. Assign access to Virtual machine

  5. Choose subscription

  6. Select VM

Can someone help with example how do I do this in terraform?

Also, I want to select multiple VM here so I need an example for the same.

2 Likes

Can anyone help on these?

1 Like

Just follow the provide “azurerm” documentation https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment