title: How to add Virtual Machine User Login roles to a list of users by Terraform?
body: <p><code>a@cc.com</code> &amp; <code>b@cc.com</code> are E-mail addresses of our organization. These emails are also used as the Azure login accounts. I've set up a Terraform code to use the AzureAD to access to the VM in Azrue. My question is How Can I grand those accounts the role of <strong>Virtual Machine User Login</strong>?</p>
  
  <pre><code>resource "azurerm_role_assignment" "test" {
    scope              = "${data.azurerm_management_group.primary.id}"
    role_definition_id = "Virtual Machine User Login"
    principal_id       = "a@cc.com, b@cc.com"
  }
  </code></pre>
  
  <p>The <a href="https://www.terraform.io/docs/providers/azurerm/r/role_assignment.html#role_definition_id" rel="nofollow noreferrer">official documents</a> says <strong>principal_id</strong> is the ID of the Principal (User, Group, Service Principal, or Application) to assign the Role Definition to. Isn't the that the email address is the ID of the user?</p>