Exam Notes
Assign roles at the highest appropriate scope to reduce management overhead. A Reader role at subscription level gives read access to all resources in that subscription.
RBAC & Identity
A security principal is an object that represents a user, group, service principal, or managed identity that is requesting access to Azure resources.
User
Group
Service Principal
Managed Identity
A role definition is a collection of permissions. It lists the actions that can be performed, such as read, write, and delete. Roles can be built-in or custom.
| Role | Description | Actions | Use Case |
|---|---|---|---|
| Owner | Full access including RBAC | * | Subscription admins, resource owners |
| Contributor | Create/manage all resources | * except role assignments | Developers, operators |
| Reader | View all resources | */read | Auditors, support, monitoring |
| User Access Administrator | Manage user access only | Role assignments only | Delegated RBAC management |
Permission Types
Microsoft.Compute/virtualMachines/read)Action Format
{Company}.{ProviderName}/{resourceType}/{action}
Examples:
Microsoft.Compute/virtualMachines/read
Microsoft.Storage/storageAccounts/write
Microsoft.Authorization/roleAssignments/*Scope is the set of resources that the access applies to. Role assignments at a parent scope are inherited by child scopes.
Permissions flow down - assignments at higher scopes apply to all children
When built-in roles don't meet your needs, create custom roles with specific permissions. Custom roles can be scoped to management groups, subscriptions, or resource groups.
When to Use Custom Roles
Best Practices
NotActions to exclude specific permissionsAssignableScopes carefully{
"Name": "Virtual Machine Operator",
"Description": "Can start, stop, and restart VMs",
"Actions": [
"Microsoft.Compute/virtualMachines/start/action",
"Microsoft.Compute/virtualMachines/powerOff/action",
"Microsoft.Compute/virtualMachines/restart/action",
"Microsoft.Compute/virtualMachines/read"
],
"NotActions": [],
"DataActions": [],
"NotDataActions": [],
"AssignableScopes": [
"/subscriptions/{subscription-id}"
]
}Deny assignments block users from performing specific actions even if a role assignment grants access. Deny takes precedence over allow.
How Deny Works
Created By
PIM provides time-based and approval-based role activation to reduce the risks of excessive, unnecessary, or misused access. It's a feature of Microsoft Entra ID Premium P2.
Just-in-Time Access
Users activate roles only when needed, for a limited time period (e.g., 8 hours).
Approval Workflow
Require approval from designated approvers before role activation.
MFA Enforcement
Require multi-factor authentication to activate any role.
Access Reviews
Periodic reviews to ensure users still need their role assignments.
Audit History
Complete audit trail of all PIM activities for compliance.
Notifications
Email alerts when privileged roles are activated.
| Assignment Type | Description | Access |
|---|---|---|
| Eligible | User can activate the role when needed | No access until activated |
| Active | User has the role without activation | Immediate, permanent access |
| Time-bound Active | Active for a specific time period | Access expires automatically |
Use Groups
Assign roles to groups, not individuals. Easier to manage and audit.
Least Privilege
Grant only the permissions needed. Start restrictive, add as needed.
Appropriate Scope
Assign at the highest scope that makes sense, but no higher.
Use PIM
For privileged roles, require just-in-time activation.
Regular Reviews
Periodically review role assignments. Remove stale access.
Built-in First
Use built-in roles when possible. Custom only when necessary.
| Concept | Description | Example |
|---|---|---|
| Security Principal | Who is requesting access | User, Group, Service Principal, Managed Identity |
| Role Definition | What actions are allowed | Owner, Contributor, Reader, Custom |
| Scope | Where the access applies | MG, Subscription, RG, Resource |
| Role Assignment | Principal + Role + Scope | "DevTeam group is Contributor on Prod-RG" |
| Deny Assignment | Block specific actions | Blueprints, Managed Apps |
| PIM | Just-in-time privileged access | Eligible assignments, approval workflow |