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

Disk Snapshot ContributorAzure built-in role

Provides permission to backup vault to manage disk snapshots.

Role ID7efff54f-a5b4-42b5-a1c5-5411624893ce
CategoryCompute
Actions12
Data actions0

What it can do

PermissionWhat it allows
Microsoft.Authorization/*/readAny read operation on anything under Microsoft.Authorization
Microsoft.Resources/subscriptions/resourceGroups/readGets or lists resource groups.
Microsoft.Compute/snapshots/deleteDelete a Snapshot
Microsoft.Compute/snapshots/writeCreate a new Snapshot or update an existing one
Microsoft.Compute/snapshots/readGet the properties of a Snapshot
Microsoft.Compute/snapshots/beginGetAccess/actionGet the SAS URI of the Snapshot for blob access
Microsoft.Compute/snapshots/endGetAccess/actionRevoke the SAS URI of the Snapshot
Microsoft.Compute/disks/beginGetAccess/actionGet the SAS URI of the Disk for blob access
Microsoft.Storage/storageAccounts/listkeys/actionReturns the access keys for the specified storage account.
Microsoft.Storage/storageAccounts/writeCreates a storage account with the specified parameters or update the properties or tags or adds custom domain for the specified storage account.
Microsoft.Storage/storageAccounts/readReturns the list of storage accounts or gets the properties for the specified storage account.
Microsoft.Storage/storageAccounts/deleteDeletes an existing storage account.

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 "Disk Snapshot Contributor" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "Disk Snapshot Contributor" `
  -Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
bicep7 lines
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
  name: guid(resourceGroup().id, principalId, '7efff54f-a5b4-42b5-a1c5-5411624893ce')
  properties: {
    roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7efff54f-a5b4-42b5-a1c5-5411624893ce')
    principalId: principalId
  }
}

Who already has it?

kql · azure resource graph
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "7efff54f-a5b4-42b5-a1c5-5411624893ce"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)

Other compute roles

Find the smallest role for a task →