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

Deployment Environments ReaderAzure built-in role

Provides read access to environment resources.

Role IDeb960402-bf75-4cc3-8d68-35b34f960f72
CategoryDevops
Actions4 (minus 2 NotActions)
Data actions3

Before you assign it

  • It reaches the data, not just the resource. It has 3 data actions, such as reading blobs, secrets or messages.

What it can do

PermissionWhat it allows
Microsoft.DevCenter/projects/readLists all projects in the subscription.
Microsoft.DevCenter/projects/*/readAny read operation on anything under Microsoft.DevCenter/projects
Microsoft.Authorization/*/readAny read operation on anything under Microsoft.Authorization
Microsoft.Resources/subscriptions/resourceGroups/readGets or lists resource groups.

Can't do

These are taken away from the actions above.

PermissionWhat it allows
Microsoft.DevCenter/projects/pools/readLists pools for a project
Microsoft.DevCenter/projects/pools/schedules/readLists schedules for a pool

Data actions

PermissionWhat it allows
Microsoft.DevCenter/projects/users/environments/adminRead/actionAllows a project administrator to read all of the environments in a project.
Microsoft.DevCenter/projects/users/environments/adminActionRead/actionAllows an admin to read environment actions.
Microsoft.DevCenter/projects/users/environments/adminOutputsRead/actionAllows an admin to read Output values from environment deployment.

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 "Deployment Environments Reader" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "Deployment Environments Reader" `
  -Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
bicep7 lines
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
  name: guid(resourceGroup().id, principalId, 'eb960402-bf75-4cc3-8d68-35b34f960f72')
  properties: {
    roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'eb960402-bf75-4cc3-8d68-35b34f960f72')
    principalId: principalId
  }
}

Who already has it?

kql · azure resource graph
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "eb960402-bf75-4cc3-8d68-35b34f960f72"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)

Other devops roles

Find the smallest role for a task →