RBAC & Backup Security
Azure role assignments · custom roles (Azure and Microsoft Entra) · overprivileged access · Azure Backup soft delete, immutability, multi-user authorization, encryption and roles
By the tools4free.dev team · Last reviewed November 13, 2026
Practice questions for this topic →
Manage Azure built-in role assignments
A role assignment ties a security principal to a role definition at a scope. Azure RBAC is additive: your effective permissions are the sum of your role assignments.
- To assign roles you need
Microsoft.Authorization/roleAssignments/write, for example through Role Based Access Control Administrator or User Access Administrator. Without it, Add role assignment is disabled on the Access control (IAM) page. - Scope has four levels, broad to narrow: management group, subscription, resource group, resource. Permissions assigned at a parent scope are inherited by child scopes.
- Privileged administrator roles are Owner, Contributor, User Access Administrator and Role Based Access Control Administrator. Other roles are job function roles.
- Assign roles to groups instead of users, and use the unique role ID instead of the role name in scripts: the ID does not change when a role is renamed.
- The portal can add a condition to a role assignment when the selected role supports conditions (for example storage data roles, or the delegation roles Owner, Role Based Access Control Administrator and User Access Administrator).
- Azure roles and Microsoft Entra roles are separate: Entra role assignments do not grant access to Azure resources, and Azure role assignments do not grant access to Entra ID.
| Assignment type | Meaning |
|---|---|
| Active permanent | The user can always use the role without any action. |
| Active time-bound | The user can use the role without action only between start and end dates. |
| Eligible permanent | The user can always activate the role. |
| Eligible time-bound | The user can activate the role only between start and end dates. |
The Assignment type tab appears at management group, subscription and resource group scopes when you have a Microsoft Entra ID P2 or Microsoft Entra ID Governance license. Eligible means the user must do something to use the role, such as an MFA check, a business justification or an approval. You cannot create eligible assignments for applications, service principals or managed identities, because they cannot perform activation steps. To skip PIM, pick Active and Permanent.
- Limit: up to 5000 role assignments per subscription (subscription, resource group and resource scopes, but not management group scope; a management group has its own fixed limit of 500). Eligible and future-scheduled assignments do not count. It cannot be increased. The error is
RoleAssignmentLimitExceeded; assigning to groups reduces the count. - Elevate access: a Global Administrator who turns on elevated access is assigned User Access Administrator at root scope (
/). Remove it when the work is done. - NotActions subtracts actions from a wildcard
Actionsvalue. It is not a deny rule: a second role that grants the action still allows it. Control plane roles do not give data plane access when the container uses Microsoft Entra authentication rather than the access key.
Custom roles: Azure and Microsoft Entra
Azure custom roles
Create a custom role when no built-in role fits. Typically start from an existing built-in role and modify it. Tools: Azure portal, PowerShell, CLI or REST API.
| Property | Notes |
|---|---|
Actions / NotActions | Control plane actions allowed / excluded from the allowed actions. |
DataActions / NotDataActions | Data plane actions. A custom role with DataActions cannot be assigned at management group scope. |
AssignableScopes | Where the role can be assigned. It also decides who can create, update, delete or view the role. |
- Limits: 5,000 custom roles per tenant.
AssignableScopesmaximum 2,000 entries, cannot be the root scope (/), cannot contain wildcards, and can name only one management group. - A custom role can be shared between subscriptions that trust the same Microsoft Entra tenant, and can be assigned at management group, subscription and resource group scopes.
- Creating, updating or deleting needs
Microsoft.Authorization/roleDefinitions/writeon all of the role'sAssignableScopes; viewing needsroleDefinitions/read. - Microsoft recommends listing
ActionsandDataActionsexplicitly instead of using a wildcard, because future permissions added under a wildcard may be unwanted. - Delete order: remove every role assignment that uses the role first (including eligible assignments in PIM), then delete the role. Otherwise you get
RoleDefinitionHasAssignments.
Microsoft Entra custom roles
- Entra roles control Entra resources (users, groups, applications) through Microsoft Graph. Azure roles control Azure resources through Azure Resource Management. Entra permissions cannot be used in Azure custom roles and vice versa.
- Built-in Entra roles have a fixed set of permissions and cannot be modified. Using built-in roles is free; custom roles need a Microsoft Entra ID P1 license for every user with a custom role assignment.
- Creating a custom Entra role needs a Microsoft Entra ID P1 or P2 license and the Privileged Role Administrator role. Use the Entra admin center, Microsoft Graph PowerShell or Microsoft Graph API.
- Custom roles can only include permissions that are enabled for custom use. You can clone a custom role but not a built-in role.
- Entra role assignments use a security principal, a role definition and a scope. Azure CLI is not supported for Entra role assignments.
- Microsoft's pages differ on which scopes a custom Entra role can use: the custom roles overview lists tenant, administrative unit and Entra resources (groups, enterprise applications, app registrations), while the create-custom-role page says a custom role can be assigned only at directory-level scope or an app registration resource scope. For any Entra role assignment, a role assigned over a container scope such as the tenant or an administrative unit grants permissions over the objects inside, not the container itself. A role assigned over a resource scope does not extend to members of a group.
- With Entra ID P1 you can create role-assignable groups and assign roles to them. With P2, PIM gives just-in-time role access.
Evaluate and remediate overprivileged access
- List privileged administrator role assignments: on the Role assignments tab of Access control (IAM) you see their count at the current scope. Open Manage privileged role assignments to add a condition or remove an assignment.
- Check owners: keep a maximum of 3 subscription owners; Defender for Cloud can monitor this.
- Remove unnecessary privileged assignments. Use a job function role instead of a privileged administrator role when one fits.
- Narrow the scope: if a privileged role is required, assign it at resource group or resource, not management group or subscription.
- Constrain delegation: to let someone assign roles, give Role Based Access Control Administrator with a condition instead of Owner or User Access Administrator.
- Reduce standing access: use PIM eligible assignments, and run PIM access reviews so stale role assignments are removed.
| Role | Can assign roles? |
|---|---|
| Owner | Yes (and full access to all resources). |
| Contributor | No. Full access to manage all resources. |
| User Access Administrator | Yes; can give themselves or others Owner. |
| Role Based Access Control Administrator | Yes; can give themselves or others Owner. A condition can constrain what they assign. |
- Without a condition, a delegate with an unrestricted assignment can assign any role to any user in scope, including themselves, and can give Owner or User Access Administrator to someone else.
- PIM access reviews for Azure resource roles need Owner or User Access Administrator on the resources; for Entra roles at least Privileged Role Administrator. Reviewers can be selected users, members (self) or managers. The setting for reviewers who don't respond offers No change, Remove access, Approve access or Take recommendations.
- Access reviews of service principals need a Microsoft Entra Workload ID Premium plan plus Entra ID P2 or Entra ID Governance.
Azure Backup security features
Vaulted backup data sits in a Microsoft-managed subscription and tenant, separate from production. It is not a physical or offline air gap and does not replace controls over the identities that manage the vault.
| Control | What it does | Key facts |
|---|---|---|
| Azure RBAC roles | Separate duties. | Backup Contributor: create and manage backups, except deleting the Recovery Services vault or granting access. Backup Operator: backup operations except removing backups and managing policies. Backup Reader: view only. |
| Soft delete | Keeps deleted backup data recoverable. | Default retention 14 days, extendable to 180. First 14 days at no charge. Microsoft's pages differ on enforcement: the secure-by-default page says default enforcement is currently in preview for Recovery Services vaults but also describes GA behaviour, and the security overview says enforcement varies by vault type, workload and region. Treat the status as unsettled. A deleted vault moves to a soft-deleted state. |
| Immutable vault | Blocks operations that lose recovery points. | States: Disabled, Enabled (can be disabled), Enabled and locked (irreversible, WORM). Reducing policy retention is blocked. |
| Multi-user authorization (MUA) | A second person approves critical operations. | Uses a Resource Guard owned by a different user. Disabling soft delete and removing MUA protection cannot be excluded. |
| Encryption | Protects data at rest and in transit. | Microsoft-managed keys by default; customer-managed keys from Key Vault optional. HTTPS and TLS 1.2 or later in transit. |
Immutability details
- Enabling immutability is reversible; locking it is not. Immutability applies to all data in the vault, not to operational backups of blobs, files and disks. The
Microsoft.RecoveryServicesresource provider must be registered. - Enable based on backup policy (default) keeps recovery points immutable as long as the policy retains them. Enable for specific duration sets a fixed number of days; policy retention cannot then drop below it.
- You can still stop protection and keep the data. Stop protection with delete of data is blocked until recovery points expire.
Set up MUA with a Resource Guard
- The Security admin creates the Resource Guard in the same region as the vault, ideally in a different subscription or tenant.
- Give the Backup admin the Reader role on the Resource Guard.
- The Backup admin enables MUA on the vault by selecting the Resource Guard.
- For a protected operation, the Backup admin needs the Backup MUA Operator role on the Resource Guard, ideally as a PIM eligible assignment with approvers.
- The Backup admin must not hold Contributor, Backup MUA Admin or Backup MUA Operator on the Resource Guard or its subscription. Both subscriptions must be registered for
Microsoft.RecoveryServicesandMicrosoft.DataProtection. - If PIM has no approver configured, requests for the role are approved automatically.
- Defaults: all supported critical operations are enabled; Delete protection, Modify protection and Modify policy are optional and can be excluded.
- Customer-managed keys: only for new Recovery Services vaults; keys must be in Key Vault in the same region, RSA, enabled. Steps: enable a managed identity on the vault, give it key permissions, enable soft delete and purge protection on the Key Vault, assign the key. You cannot go back to Microsoft-managed keys.
- Security levels: Excellent needs locked immutability or always-on soft delete plus MUA. Good needs immutability locked or soft delete. Fair needs MUA on the vault. Poor means only reversible or no protections.
- Threat detection (uses Defender for Servers signals) and cross-tenant restore are in preview, per Microsoft Learn at the time of writing.
- Azure VM backup traffic uses the Azure backbone and does not need access to your virtual network.
CLI and PowerShell
| Task | Azure CLI | PowerShell |
|---|---|---|
| Assign an Azure role | az role assignment create --assignee "{assignee}" --role "{roleNameOrId}" --scope "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}" | New-AzRoleAssignment -SignInName <emailOrUserprincipalname> -RoleDefinitionName <roleName> -ResourceGroupName <resourceGroupName> |
| Create or update an Azure custom role from JSON | az role definition create --role-definition {roleDefinition} | - |
| Create a Resource Guard for MUA | az dataprotection resource-guard create --location "Location" --tags key1="val1" --resource-group "RgName" --resource-guard-name "ResourceGuardName" | New-AzDataProtectionResourceGuard -Location “Location” -Name “ResourceGuardName” -ResourceGroupName “rgName” |
Exam Tips
Tick each tip once you can answer it without looking.
“A user cannot see Add role assignment enabled in Access control (IAM)” → Missing Microsoft.Authorization/roleAssignments/write; Role Based Access Control Administrator or User Access Administrator supplies it. Trap: Contributor can manage all resources but cannot assign roles.
“Script assigns a role by name and breaks after the role is renamed” → Use the unique role ID; the ID does not change when a role is renamed. Trap: Role names can change, for example a preview role losing its (Preview) label.
“RoleAssignmentLimitExceeded on a subscription” → 5000 per subscription, fixed. Assign to groups and consolidate. Eligible and future-scheduled assignments do not count; management group assignments do not count. Trap: Asking for a limit increase: it cannot be increased.
“Make a user eligible, not permanently active, for an Azure role” → Active or eligible assignment type (needs Entra ID P2 or Governance); user activates with MFA, justification or approval. Trap: Eligible assignments cannot be created for applications, service principals or managed identities.
“A custom role's NotActions removes an action, but the user can still do it” → NotActions is not a deny; another role that grants the action allows it. Trap: NotActions only subtracts from the allowed set of that one role.
“Custom role with DataActions must be used in many subscriptions” → Name one management group in AssignableScopes and assign it at each subscription; it cannot be assigned at the management group itself. Trap: DataActions roles cannot be assigned at management group scope.
“Custom role cannot be deleted: RoleDefinitionHasAssignments” → Remove all assignments of the role (including PIM eligible ones) first, then delete it. Trap: Deleting the role definition directly.
“Create a custom Microsoft Entra role” → Entra ID P1 or P2 plus Privileged Role Administrator; use the Entra admin center or Microsoft Graph. Users with the role need P1. Trap: Azure CLI does not manage Entra role assignments; Entra permissions cannot be used in Azure custom roles.
“Let a helpdesk lead assign only the Reader role, only to users” → Role Based Access Control Administrator with a condition. Trap: Owner or User Access Administrator lets the delegate assign any role, including to themselves and to Owner.
“Reduce overprivileged access on a subscription” → Max 3 owners, remove unneeded privileged assignments, job function roles, narrow scopes, PIM eligibility and access reviews. Trap: Assigning Contributor at subscription scope for convenience.
“Global Administrator cannot see any subscriptions” → Turn on elevate access: gets User Access Administrator at root scope; remove it afterwards. Trap: Entra roles do not grant access to Azure resources.
“Backup operator must start backups and restores but never delete or change policies” → Backup Operator role: everything a contributor does except removing backup and managing backup policies. Trap: Backup Contributor can also stop backup and delete data; Backup Reader is view-only.
“Prevent one compromised admin from disabling soft delete on a vault” → MUA with a Resource Guard owned by a different user, preferably in another subscription or tenant. Trap: Giving the vault admin Contributor on the Resource Guard defeats MUA. Disabling soft delete and removing MUA cannot be excluded.
“Deleted backup data must be recoverable for 30 days” → Soft delete retention is 14 days by default, extendable up to 180; days beyond 14 can incur charges. Trap: Soft delete does not give indefinite retention.
“Make backups irreversibly undeletable before retention ends” → Immutable vault set to Enabled and locked (WORM). Trap: Plain Enabled can be disabled; locking cannot be undone. Immutability does not cover operational backups of blobs, files or disks.
“Customer-managed key encryption for a vault that already has backup items” → Not supported: only new Recovery Services vaults; Key Vault in the same region with soft delete and purge protection enabled; no way back to Microsoft-managed keys. Trap: Assuming CMK can be switched on any time or reverted.
“Approvals for a protected backup operation go through automatically” → No approver configured in PIM for the Backup MUA Operator role. Trap: Assuming Resource Guard alone forces a review.
Sources
- Assign Azure roles using the Azure portal
- Assign Azure roles using Azure CLI
- Assign Azure roles using Azure PowerShell
- List Azure role assignments using the Azure portal
- Best practices for Azure RBAC
- Azure RBAC overview
- Understand Azure role definitions
- Azure custom roles
- Create or update Azure custom roles using Azure CLI
- Troubleshoot Azure RBAC limits
- Elevate access to manage all subscriptions
- Delegate Azure access management to others
- Overview of Microsoft Entra role-based access control
- Create a custom role in Microsoft Entra ID
- Create an access review of Azure resource and Microsoft Entra roles in PIM
- Security and cyber recovery in Azure Backup
- Secure by default with soft delete
- Immutable vault concept
- Multiuser authorization using Resource Guard
- Configure multi-user authorization
- Encrypt backup data by using customer-managed keys
- Manage backups with Azure RBAC
Checked against Microsoft Learn on November 13, 2026.