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

Storage Account Key Operator Service RoleAzure built-in role

Storage Account Key Operators are allowed to list and regenerate keys on Storage Accounts

Role ID81a9662b-bebf-436f-a333-f67b29880f12
CategoryStorage
Actions2
Data actions0

What it can do

PermissionWhat it allows
Microsoft.Storage/storageAccounts/listkeys/actionReturns the access keys for the specified storage account.
Microsoft.Storage/storageAccounts/regeneratekey/actionRegenerates the access keys for the specified 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 "Storage Account Key Operator Service Role" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "Storage Account Key Operator Service Role" `
  -Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
bicep7 lines
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
  name: guid(resourceGroup().id, principalId, '81a9662b-bebf-436f-a333-f67b29880f12')
  properties: {
    roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '81a9662b-bebf-436f-a333-f67b29880f12')
    principalId: principalId
  }
}

Who already has it?

kql · azure resource graph
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "81a9662b-bebf-436f-a333-f67b29880f12"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)

Other storage roles

Find the smallest role for a task →