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

Desktop Virtualization Virtual Machine ContributorAzure built-in role

This role is in preview and subject to change. Provide permission to the Azure Virtual Desktop Resource Provider to create, delete, update, start, and stop virtual machines.

Role IDa959dbd1-f747-45e3-8ba6-dd80f235f97c
CategoryCompute
Actions58
Data actions0

What it can do

PermissionWhat it allows
Microsoft.DesktopVirtualization/hostpools/readRead hostpools
Microsoft.DesktopVirtualization/hostpools/writeWrite hostpools
Microsoft.DesktopVirtualization/hostpools/retrieveRegistrationToken/actionRetrieve registration token for host pool
Microsoft.DesktopVirtualization/hostpools/sessionhosts/readRead hostpools/sessionhosts
Microsoft.DesktopVirtualization/hostpools/sessionhosts/writeWrite hostpools/sessionhosts
Microsoft.DesktopVirtualization/hostpools/sessionhosts/deleteDelete hostpools/sessionhosts
Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/readRead hostpools/sessionhosts/usersessions
Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/disconnect/actionDisconnects the user session form session host
Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/sendMessage/actionSend message to user session
Microsoft.DesktopVirtualization/hostpools/sessionHostConfigurations/readRead hostpools/sessionhostconfigurations
Microsoft.DesktopVirtualization/hostpools/doNotUseInternalAPI/actionInternal operation that is not meant to be called by customers. This will be removed in a future version. Do not use it.
Microsoft.DesktopVirtualization/hostpools/sessionhosts/retryprovisioning/actionAction on retryprovisioning.
Microsoft.Compute/availabilitySets/readGet the properties of an availability set
Microsoft.Compute/availabilitySets/writeCreates a new availability set or updates an existing one
Microsoft.Compute/availabilitySets/vmSizes/readList available sizes for creating or updating a virtual machine in the availability set
Microsoft.Compute/disks/readGet the properties of a Disk
Microsoft.Compute/disks/writeCreates a new Disk or updates an existing one
Microsoft.Compute/disks/deleteDeletes the Disk
Microsoft.Compute/galleries/readGets the properties of Gallery
Microsoft.Compute/galleries/images/readGets the properties of Gallery Image
Microsoft.Compute/galleries/images/versions/readGets the properties of Gallery Image Version
Microsoft.Compute/images/readGet the properties of the Image
Microsoft.Compute/locations/usages/readGets service limits and current usage quantities for the subscription's compute resources in a location
Microsoft.Compute/locations/vmSizes/readLists available virtual machine sizes in a location
Microsoft.Compute/operations/readLists operations available on Microsoft.Compute resource provider
Microsoft.Compute/skus/readGets the list of Microsoft.Compute SKUs available for your Subscription
Microsoft.Compute/virtualMachines/readGet the properties of a virtual machine
Microsoft.Compute/virtualMachines/writeCreates a new virtual machine or updates an existing virtual machine
Microsoft.Compute/virtualMachines/deleteDeletes the virtual machine
Microsoft.Compute/virtualMachines/start/actionStarts the virtual machine
Microsoft.Compute/virtualMachines/powerOff/actionPowers off the virtual machine. Note that the virtual machine will continue to be billed.
Microsoft.Compute/virtualMachines/restart/actionRestarts the virtual machine
Microsoft.Compute/virtualMachines/deallocate/actionPowers off the virtual machine and releases the compute resources
Microsoft.Compute/virtualMachines/runCommand/actionExecutes a predefined script on the virtual machine
Microsoft.Compute/virtualMachines/extensions/readGet the properties of a virtual machine extension
Microsoft.Compute/virtualMachines/extensions/writeCreates a new virtual machine extension or updates an existing one
Microsoft.Compute/virtualMachines/extensions/deleteDeletes the virtual machine extension
Microsoft.Compute/virtualMachines/runCommands/readGet the properties of a virtual machine run command
Microsoft.Compute/virtualMachines/runCommands/writeCreates a new virtual machine run command or updates an existing one
Microsoft.Compute/virtualMachines/vmSizes/readLists available sizes the virtual machine can be updated to
Microsoft.Network/networkSecurityGroups/readGets a network security group definition
Microsoft.Network/networkInterfaces/writeCreates a network interface or updates an existing network interface.
Microsoft.Network/networkInterfaces/readGets a network interface definition.
Microsoft.Network/networkInterfaces/join/actionJoins a Virtual Machine to a network interface. Not Alertable.
Microsoft.Network/networkInterfaces/deleteDeletes a network interface
Microsoft.Network/virtualNetworks/subnets/readGets a virtual network subnet definition
Microsoft.Network/virtualNetworks/subnets/join/actionJoins a virtual network. Not Alertable.
Microsoft.Network/virtualNetworks/usages/readGet the IP usages for each subnet of the virtual network
Microsoft.Network/virtualNetworks/readGet the virtual network definition
Microsoft.Marketplace/offerTypes/publishers/offers/plans/agreements/readReturns an Agreement.
Microsoft.KeyVault/vaults/deploy/actionEnables access to secrets in a key vault when deploying Azure resources
Microsoft.Storage/storageAccounts/readReturns the list of storage accounts or gets the properties for the specified storage account.
Microsoft.Authorization/*/readAny read operation on anything under Microsoft.Authorization
Microsoft.Insights/alertRules/*Every operation under Microsoft.Insights/alertRules
Microsoft.Resources/deployments/*Every operation under Microsoft.Resources/deployments
Microsoft.Resources/subscriptions/resourceGroups/readGets or lists resource groups.
Microsoft.DesktopVirtualization/scalingPlans/readRead scalingplans
Microsoft.DesktopVirtualization/scalingPlans/writeWrite scalingplans

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 "Desktop Virtualization Virtual Machine Contributor" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "Desktop Virtualization 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, 'a959dbd1-f747-45e3-8ba6-dd80f235f97c')
  properties: {
    roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'a959dbd1-f747-45e3-8ba6-dd80f235f97c')
    principalId: principalId
  }
}

Who already has it?

kql · azure resource graph
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "a959dbd1-f747-45e3-8ba6-dd80f235f97c"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)

Other compute roles

Find the smallest role for a task →