Always follow the principle of least privilege: grant only the permissions a principal needs to perform their job, and no more.
- Who — the security principal requesting access (user, group, service principal, or managed identity).
- What — the actions the principal can perform, defined in a role definition (JSON).
- Where — the scope where the role applies (management group, subscription, resource group, resource).
Be careful with scope and assignment counts — a subscription can have up to 2,000 role assignments. Excess or overly broad assignments can complicate management and auditability.

- Security principal — identity requesting access (user, group, service principal, managed identity).
- Role definition — collection of permissions (Actions, NotActions, DataActions, NotDataActions) expressed in JSON.
- Scope — where the role applies (management group → subscription → resource group → resource).
- Role assignment — binding of a role definition to a principal at a scope.
Actions— allowed management-plane operations."*"means all actions.NotActions— explicitly excluded operations (e.g., role assignment).AssignableScopes— where the role can be assigned;"/"refers to the tenant root.- Additional properties:
dataActions/notDataActions(data plane permissions), and other optional attributes for specific services.

- Management group
- Subscription
- Resource group
- Resource

- Select the desired scope (management group, subscription, resource group, or a resource).
- Open the resource or resource group in the portal and choose “Access control (IAM)”.
- View Role assignments to review effective assignments and inheritance (direct vs inherited assignments are shown).
- Assignments created at the subscription level appear as inherited on resource groups and resources.


- Click Add → Role assignment.
- Choose a role from the list of built-in and custom roles. Built-ins include job- or service-specific roles for least-privilege assignment.
- Click Next → Members to select users, groups, or service principals.
- Review and click Assign.


- Navigate to the desired scope (management group, subscription, or resource group).
- In Access control (IAM) choose Add → Add custom role.
- Provide a name and description. You can:
- Start from scratch
- Clone an existing role
- Upload a JSON role definition
- On the Permissions tab, add only the precise actions you want the role to allow (for example, specific Virtual Machine actions).
- Set Assignable scopes and create the role.



In short:
- Use Azure RBAC to control resource operations (create VMs, manage storage, etc.).
- Use Entra ID roles for identity and directory tasks (user management, tenant configuration).
- Principle of least privilege: assign only the permissions necessary.
- Prefer role assignments at the lowest practical scope to reduce blast radius.
- Use Privileged Identity Management (PIM) for just-in-time elevation rather than permanent high-privilege assignments.
- Audit role assignments regularly and consolidate or remove redundant grants.
- Use custom roles only when built-ins are insufficient; keep custom role definitions minimal and well-documented.
- Azure role-based access control (RBAC) - Microsoft Docs
- Create custom roles in Azure RBAC - Microsoft Docs
- Privileged Identity Management (PIM) - Microsoft Docs
- RBAC is built around Who (security principal), What (role definition), and Where (scope).
- Use built-in roles where they meet requirements; create custom roles for precise permission needs.
- Understand inheritance across scopes and avoid assigning broad privileges at high-level scopes.
- Use PIM for just-in-time elevation and separate Azure RBAC (resource management) from Entra ID roles (identity management).