Tutorial: Grant a user access to Azure resources using RBAC and the Azure portal

Role-based access control (RBAC) is the way that you manage access to Azure resources. In this tutorial, you grant a user access to create and manage virtual machines in a resource group.

In this tutorial, you learn how to:

  • Grant access for a user at a resource group scope
  • Remove access

If you don't have an Azure subscription, create a free account before you begin.

Sign in to Azure

Sign in to the Azure portal at https://portal.azure.com.

Create a resource group

  1. In the navigation list, click Resource groups.

  2. Click Add to open the Resource group blade.

    Add a new resource group

  3. For Resource group name, enter rbac-resource-group.

  4. Select a subscription and a location.

  5. Click Create to create the resource group.

  6. Click Refresh to refresh the list of resource groups.

    The new resource group appears in your resource groups list.

    Resource group list

Grant access

In RBAC, to grant access, you create a role assignment.

  1. In the list of Resource groups, click the new rbac-resource-group resource group.

  2. Click Access control (IAM).

  3. Click the Role assignments tab to see the current list of role assignments.

    Access control (IAM) blade for resource group

  4. Click Add > Add role assignment to open the Add role assignment pane.

    If you don't have permissions to assign roles, the Add role assignment option will be disabled.

    Add menu

    Add role assignment pane

  5. In the Role drop-down list, select Virtual Machine Contributor.

  6. In the Select list, select yourself or another user.

  7. Click Save to create the role assignment.

    After a few moments, the user is assigned the Virtual Machine Contributor role at the rbac-resource-group resource group scope.

    Virtual Machine Contributor role assignment

Remove access

In RBAC, to remove access, you remove a role assignment.

  1. In the list of role assignments, add a checkmark next to the user with the Virtual Machine Contributor role.

  2. Click Remove.

    Remove role assignment message

  3. In the remove role assignment message that appears, click Yes.

Clean up

  1. In the navigation list, click Resource groups.

  2. Click rbac-resource-group to open the resource group.

  3. Click Delete resource group to delete the resource group.

    Delete resource group

  4. On the Are you sure you want to delete blade, type the resource group name: rbac-resource-group.

  5. Click Delete to delete the resource group.

Next steps