Designing Authorization and Application Identity: RBAC, PIM, Managed Identities, App Registrations and OAuth Flows
RBAC Design Rules
- Assign roles to groups, not people
- Assign at the lowest scope that works (resource group before subscription)
- Prefer built-in roles. Create custom roles only for real gaps
- Separate duties: operators, developers, security, finance readers
- Keep Owner and User Access Administrator assignments very few
| Role | Can do |
|---|---|
| Owner | Everything, including granting access |
| Contributor | Manage resources, cannot grant access |
| Reader | View only |
| User Access Administrator | Manage access only |
| Specific roles | Storage Blob Data Reader, Key Vault Secrets User, Virtual Machine Contributor and many more |
Privileged Access Design
| Control | Purpose |
|---|---|
| PIM (Privileged Identity Management) | Eligible, time-limited, approval-based elevation for Entra and Azure roles |
| Access reviews | Regularly recertify who still needs access |
| Break-glass accounts | Two emergency cloud-only accounts excluded from risky policies, strongly protected and monitored |
| Privileged access workstations | Dedicated devices for admins |
| Administrative units | Delegate user management for a part of the directory |
Application Identity Options
| Option | Use |
|---|---|
| System-assigned managed identity | One Azure resource, lifecycle tied to it |
| User-assigned managed identity | Shared by many resources, reusable permissions |
| App registration + service principal | Apps outside Azure, multi-tenant apps, sign-in for users |
| Workload identity federation | GitHub Actions, Kubernetes and other external workloads with no secrets |
Rule If the code runs in Azure and the target supports Entra ID, use a managed identity. Avoid client secrets and passwords.
OAuth 2.0 and OpenID Connect in One Page
| Flow | Use |
|---|---|
| Authorization code (with PKCE) | Web apps, SPAs and mobile sign-in of users |
| Client credentials | Daemon or service calling an API with its own identity |
| On-behalf-of | API calls another API as the signed-in user |
| Device code | Devices without a browser |
- OpenID Connect proves who the user is (ID token). OAuth 2.0 authorizes access to an API (access token)
- Use scopes and app roles to limit what a token allows
- Use Microsoft Authentication Library (MSAL), do not write your own protocol code
Design Example
A web app with an API and a database: users sign in via authorization code flow with Conditional Access. The API validates the token and uses managed identity to read Key Vault and access SQL. Admins get PIM-eligible roles.
Practice
- Choose roles for a developer team that deploys web apps but must not manage networking
- Replace a stored database password with a managed identity design
- Choose the OAuth flow for a nightly background job
Conclusion
Design authorization with group-based least-privilege RBAC, PIM for elevation, managed or federated identities for apps and standard OAuth and OpenID Connect flows.
Quick Summary: RBAC; privileged access; app identities; OAuth; example.

