← cd ~/roles
// roles/azure · security
Locks ContributorAzure built-in role
Can Manage Locks Operations.
| Role ID | 28bf596f-4eb7-45ce-b5bc-6cf482fec137 |
|---|---|
| Category | Security |
| Actions | 3 |
| Data actions | 0 |
What it can do
| Permission | What it allows |
|---|---|
Microsoft.Authorization/locks/read | Gets locks at the specified scope. |
Microsoft.Authorization/locks/write | Add locks at the specified scope. |
Microsoft.Authorization/locks/delete | Delete locks at the specified scope. |
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 "Locks Contributor" \
--scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
-RoleDefinitionName "Locks Contributor" `
-Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(resourceGroup().id, principalId, '28bf596f-4eb7-45ce-b5bc-6cf482fec137')
properties: {
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '28bf596f-4eb7-45ce-b5bc-6cf482fec137')
principalId: principalId
}
}Who already has it?
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "28bf596f-4eb7-45ce-b5bc-6cf482fec137"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)Other security roles
- App Compliance Automation Reader · 1 permission
- Key Vault Crypto Service Release User · 1 permission
- Security Assessment Contributor · 1 permission
- Attestation Reader · 2 permissions
- Key Vault Secrets User · 2 permissions
- Attestation Contributor · 3 permissions
- Key Vault Certificate User · 4 permissions
- Microsoft Sentinel Playbook Operator · 4 permissions