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

Lab AssistantAzure built-in role

The lab assistant role

Role IDce40b423-cede-4313-a93f-9b28290b72e1
CategoryDevops
Actions17
Data actions0

What it can do

PermissionWhat it allows
Microsoft.Authorization/*/readAny read operation on anything under Microsoft.Authorization
Microsoft.Insights/alertRules/*Every operation under Microsoft.Insights/alertRules
Microsoft.LabServices/labPlans/images/readGet the properties of an image.
Microsoft.LabServices/labPlans/readGet the properties of a lab plan.
Microsoft.LabServices/labs/readGet the properties of a lab.
Microsoft.LabServices/labs/schedules/readGet the properties of a schedule.
Microsoft.LabServices/labs/users/readGet the properties of a user.
Microsoft.LabServices/labs/users/invite/actionSend email invitation to a user to join the lab.
Microsoft.LabServices/labs/virtualMachines/readGet the properties of a virtual machine.
Microsoft.LabServices/labs/virtualMachines/start/actionStart a virtual machine.
Microsoft.LabServices/labs/virtualMachines/stop/actionStop and deallocate a virtual machine.
Microsoft.LabServices/labs/virtualMachines/reimage/actionReimage a virtual machine to the last published image.
Microsoft.LabServices/labs/virtualMachines/redeploy/actionRedeploy a virtual machine to a different compute node.
Microsoft.LabServices/locations/usages/readGet Usage in a location
Microsoft.LabServices/skus/readGet the properties of a Lab Services SKU.
Microsoft.Resources/deployments/*Every operation under Microsoft.Resources/deployments
Microsoft.Resources/subscriptions/resourceGroups/readGets or lists resource groups.

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 "Lab Assistant" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "Lab Assistant" `
  -Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
bicep7 lines
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
  name: guid(resourceGroup().id, principalId, 'ce40b423-cede-4313-a93f-9b28290b72e1')
  properties: {
    roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ce40b423-cede-4313-a93f-9b28290b72e1')
    principalId: principalId
  }
}

Who already has it?

kql · azure resource graph
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "ce40b423-cede-4313-a93f-9b28290b72e1"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)

Other devops roles

Find the smallest role for a task →