azureblog.co.uk
← cd ~/roles
// roles/azure · compute

Virtual Machine ContributorAzure built-in role

Lets you manage virtual machines, but not access to them, and not the virtual network or storage account they're connected to.

Role ID9980e02c-c2be-4d73-94e8-173b1dc7cf3c
CategoryCompute
Actions45
Data actions0

What it can do

PermissionWhat it allows
Microsoft.Authorization/*/readAny read operation on anything under Microsoft.Authorization
Microsoft.Compute/availabilitySets/*Every operation under Microsoft.Compute/availabilitySets
Microsoft.Compute/locations/*Every operation under Microsoft.Compute/locations
Microsoft.Compute/virtualMachines/*Every operation under Microsoft.Compute/virtualMachines
Microsoft.Compute/virtualMachineScaleSets/*Every operation under Microsoft.Compute/virtualMachineScaleSets
Microsoft.Compute/cloudServices/*Every operation under Microsoft.Compute/cloudServices
Microsoft.Compute/disks/writeCreates a new Disk or updates an existing one
Microsoft.Compute/disks/readGet the properties of a Disk
Microsoft.Compute/disks/deleteDeletes the Disk
Microsoft.Compute/hostgroups/writeCreates a new host group or updates an existing host group
Microsoft.Compute/hostgroups/hosts/writeCreates a new host or updates an existing host
Microsoft.DevTestLab/schedules/*Every operation under Microsoft.DevTestLab/schedules
Microsoft.Insights/alertRules/*Every operation under Microsoft.Insights/alertRules
Microsoft.Network/applicationGateways/backendAddressPools/join/actionJoins an application gateway backend address pool. Not Alertable.
Microsoft.Network/loadBalancers/backendAddressPools/join/actionJoins a load balancer backend address pool. Not Alertable.
Microsoft.Network/loadBalancers/inboundNatPools/join/actionJoins a load balancer inbound NAT pool. Not alertable.
Microsoft.Network/loadBalancers/inboundNatRules/join/actionJoins a load balancer inbound nat rule. Not Alertable.
Microsoft.Network/loadBalancers/probes/join/actionAllows using probes of a load balancer. For example, with this permission healthProbe property of VM scale set can reference the probe. Not alertable.
Microsoft.Network/loadBalancers/readGets a load balancer definition
Microsoft.Network/locations/*Every operation under Microsoft.Network/locations
Microsoft.Network/networkInterfaces/*Every operation under Microsoft.Network/networkInterfaces
Microsoft.Network/networkSecurityGroups/join/actionJoins a network security group. Not Alertable.
Microsoft.Network/networkSecurityGroups/readGets a network security group definition
Microsoft.Network/publicIPAddresses/join/actionJoins a public IP address. Not Alertable.
Microsoft.Network/publicIPAddresses/readGets a public IP address definition.
Microsoft.Network/virtualNetworks/readGet the virtual network definition
Microsoft.Network/virtualNetworks/subnets/join/actionJoins a virtual network. Not Alertable.
Microsoft.RecoveryServices/locations/*Every operation under Microsoft.RecoveryServices/locations
Microsoft.RecoveryServices/Vaults/backupFabrics/backupProtectionIntent/writeCreate a backup Protection Intent
Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/*/readAny read operation on anything under Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems
Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/readReturns object details of the Protected Item
Microsoft.RecoveryServices/Vaults/backupFabrics/protectionContainers/protectedItems/writeCreate a backup Protected Item
Microsoft.RecoveryServices/Vaults/backupPolicies/readReturns all Protection Policies
Microsoft.RecoveryServices/Vaults/backupPolicies/writeCreates or Updates Protection Policy
Microsoft.RecoveryServices/Vaults/readThe Get Vault operation gets an object representing the Azure resource of type 'vault'
Microsoft.RecoveryServices/Vaults/usages/readReturns usage details for a Recovery Services Vault.
Microsoft.RecoveryServices/Vaults/writeCreate Vault operation creates an Azure resource of type 'vault'
Microsoft.ResourceHealth/availabilityStatuses/readGets the availability statuses for all resources in the specified scope
Microsoft.Resources/deployments/*Every operation under Microsoft.Resources/deployments
Microsoft.Resources/subscriptions/resourceGroups/readGets or lists resource groups.
Microsoft.SerialConsole/serialPorts/connect/action
Microsoft.SqlVirtualMachine/*Every operation under Microsoft.SqlVirtualMachine
Microsoft.Storage/storageAccounts/listKeys/actionReturns the access keys for the specified storage account.
Microsoft.Storage/storageAccounts/readReturns the list of storage accounts or gets the properties for the specified storage account.
Microsoft.Support/*Every operation under Microsoft.Support

Assign it

Scope it as tightly as you can: a resource or resource group rather than the whole subscription.

azure cli
az role assignment create \
  --assignee "jane.doe@contoso.com" \
  --role "Virtual Machine Contributor" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "Virtual Machine Contributor" `
  -Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
bicep7 lines
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
  name: guid(resourceGroup().id, principalId, '9980e02c-c2be-4d73-94e8-173b1dc7cf3c')
  properties: {
    roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '9980e02c-c2be-4d73-94e8-173b1dc7cf3c')
    principalId: principalId
  }
}

Who already has it?

kql · azure resource graph
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "9980e02c-c2be-4d73-94e8-173b1dc7cf3c"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)

Other compute roles

Find the smallest role for a task →