What if managing who can do what in your cloud was as easy as assigning a role?
Access policies vs RBAC in Azure - When to Use Which
Start learning this pattern below
Jump into concepts and practice - no test required
Imagine you have a big office building where many people need different keys to enter certain rooms. You try to keep track of who has which key by writing names on paper and handing out physical keys yourself.
This manual way is slow and confusing. You might forget who has which key, give the wrong key by mistake, or lose track when people change roles. It's hard to keep everything safe and organized.
Access policies and RBAC (Role-Based Access Control) are like smart digital key systems. They let you set clear rules about who can enter which rooms automatically, based on their role or specific permissions, making management easy and secure.
Give user A access to resource X by manually updating each resource's access list.Assign user A the 'Reader' role on resource X using RBAC.It enables secure, scalable, and easy control over who can do what in your cloud environment without manual errors.
In a company, the HR team can be given access only to employee records, while developers get access to code repositories, all managed automatically through RBAC roles.
Manual access control is slow and error-prone.
Access policies and RBAC automate permission management.
This improves security and simplifies administration.
Practice
Solution
Step 1: Understand Access Policies
Access Policies give permissions directly on specific resources, like a key vault.Step 2: Understand RBAC
RBAC assigns roles with permissions at different levels like subscription or resource group.Final Answer:
Access Policies grant permissions directly on resources; RBAC assigns roles at scopes. -> Option BQuick Check:
Access Policies = direct resource permissions, RBAC = role-based scopes [OK]
- Confusing Access Policies with RBAC roles
- Thinking RBAC only applies to virtual machines
- Assuming Access Policies control network settings
Solution
Step 1: Identify correct RBAC command
The Azure CLI command to assign RBAC roles is 'az role assignment create' with assignee, role, and scope parameters.Step 2: Verify other options
Other options mention access policies or unrelated commands which are invalid for RBAC role assignment.Final Answer:
az role assignment create --assignee <user> --role <role> --scope <scope> -> Option DQuick Check:
RBAC role assignment uses 'az role assignment create' [OK]
- Using access policy commands for RBAC
- Mixing VM or network commands with RBAC
- Omitting the scope parameter
"permissions": {"keys": ["get", "list"], "secrets": ["get"]}
What permissions does this policy grant?Solution
Step 1: Read the permissions for keys
The keys permission includes 'get' and 'list', so it allows reading and listing keys.Step 2: Read the permissions for secrets
The secrets permission includes only 'get', so it allows reading secrets but no other actions.Final Answer:
Allows getting and listing keys, and getting secrets. -> Option CQuick Check:
Permissions match get/list keys and get secrets [OK]
- Assuming 'get' means create or delete
- Confusing 'list' with full control
- Ignoring secret permissions
Solution
Step 1: Understand RBAC vs Access Policies for Key Vault
Key vault secrets require access policies to grant permissions, RBAC alone may not suffice.Step 2: Analyze the problem
Even if RBAC role is assigned, without an access policy granting secret permissions, access is denied.Final Answer:
The user lacks an access policy granting secret permissions on the key vault. -> Option AQuick Check:
Key vault secret access requires access policies [OK]
- Assuming RBAC alone controls key vault secrets
- Thinking subscription-level RBAC restricts access
- Believing portal restart fixes permission issues
Solution
Step 1: Choose RBAC as best practice
Azure recommends RBAC for Key Vault. Disable access policies and enable RBAC authorization on the Key Vault.Step 2: Assign granular roles at Key Vault scope
Assign 'Key Vault Secrets User' role to user (get/list secrets). Assign 'Key Vault Crypto Officer' role to group (manage keys).Final Answer:
Assign specific RBAC roles to the user for secret read (Key Vault Secrets User) and to the group for key management (Key Vault Crypto Officer). -> Option AQuick Check:
RBAC Secrets User + Crypto Officer roles [OK]
- Trying to mix Access Policies and RBAC (not possible)
- Using access policies for everything (legacy method)
- Assigning overly broad roles or permissions
