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

CosmosBackupOperatorAzure built-in role

Can submit restore request for a Cosmos DB database or a container for an account

Role IDdb7b14f2-5adf-42da-9f96-f2ee17bab5cb
CategoryDatabases
Actions2
Data actions0

What it can do

PermissionWhat it allows
Microsoft.DocumentDB/databaseAccounts/backup/actionSubmit a request to trigger external backup operation
Microsoft.DocumentDB/databaseAccounts/restore/actionSubmit a request to trigger external restore operation

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 "CosmosBackupOperator" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "CosmosBackupOperator" `
  -Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
bicep7 lines
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
  name: guid(resourceGroup().id, principalId, 'db7b14f2-5adf-42da-9f96-f2ee17bab5cb')
  properties: {
    roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'db7b14f2-5adf-42da-9f96-f2ee17bab5cb')
    principalId: principalId
  }
}

Who already has it?

kql · azure resource graph
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "db7b14f2-5adf-42da-9f96-f2ee17bab5cb"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)

Other databases roles

Find the smallest role for a task →