← cd ~/roles
// roles/azure · storage
Reader and Data AccessAzure built-in role
Lets you view everything but will not let you delete or create a storage account or contained resource. It will also allow read/write access to all data contained in a storage account via access to storage account keys.
| Role ID | c12c1c16-33a1-487b-954d-41c89c60f349 |
|---|---|
| Category | Storage |
| Actions | 3 |
| Data actions | 0 |
What it can do
| Permission | What it allows |
|---|---|
Microsoft.Storage/storageAccounts/listKeys/action | Returns the access keys for the specified storage account. |
Microsoft.Storage/storageAccounts/ListAccountSas/action | Returns the Account SAS token for the specified storage account. |
Microsoft.Storage/storageAccounts/read | Returns the list of storage accounts or gets the properties for the specified storage account. |
Assign it
Scope it as tightly as you can: a resource or resource group rather than the whole subscription.
az role assignment create \
--assignee "jane.doe@contoso.com" \
--role "Reader and Data Access" \
--scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
-RoleDefinitionName "Reader and Data Access" `
-Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(resourceGroup().id, principalId, 'c12c1c16-33a1-487b-954d-41c89c60f349')
properties: {
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'c12c1c16-33a1-487b-954d-41c89c60f349')
principalId: principalId
}
}Who already has it?
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "c12c1c16-33a1-487b-954d-41c89c60f349"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)Other storage roles
- Azure File Sync Reader · 1 permission
- Storage Blob Delegator · 1 permission
- Storage File Data SMB Share Reader · 1 permission
- Storage File Data SMB Take Ownership · 1 permission
- Storage File Delegator · 1 permission
- Storage Queue Data Message Sender · 1 permission
- Storage Queue Delegator · 1 permission
- Storage Table Delegator · 1 permission