Access Control Scenarios: Real-World Patterns
Combine Entra ID, RBAC, and Azure Policy to solve real enterprise access problems
๐ก Intermediate
โฑ 20 Minutes
๐ AZ-104 ยท Module 01
Why This Matters
Understanding RBAC, Entra ID, and Policy in theory is one thing. Knowing how to combine them to solve real business problems is another. This doc walks through enterprise scenarios you'll actually encounter: delegating admin duties, securing development environments, controlling costs, enforcing compliance.
Scenario 1: Delegating Department Admin Duties
The Problem
TechCorp has:
- Finance department (30 people, their own subscriptions)
- Engineering department (50 people, their own subscriptions)
- Operations (20 people, shared infrastructure)
Goal: Finance VP can manage Finance Azure, but NOT see Engineering. Vice versa. Central IT keeps overall control.
Architecture Solution
Step 1: Create Management Groups by Department
Root (TechCorp)
โโโ Finance Department (MG)
โ โโโ Finance-Prod (Subscription)
โ โโโ Finance-Dev (Subscription)
โ โโโ Finance-Backup (Subscription)
โโโ Engineering Department (MG)
โ โโโ Eng-Prod (Subscription)
โ โโโ Eng-Dev (Subscription)
โ โโโ Eng-Test (Subscription)
โโโ Operations (MG)
โโโ Ops-Infra (Subscription)
โโโ Ops-Network (Subscription)
Step 2: Create Entra Groups
grp-finance-admins
โโโ Members: Finance VP, Finance team leads
โโโ Purpose: Finance management
grp-engineering-admins
โโโ Members: Engineering VP, Engineering team leads
โโโ Purpose: Engineering management
grp-operations-admins
โโโ Members: Ops director, senior ops engineers
โโโ Purpose: Infrastructure management
Step 3: Assign RBAC Roles by Management Group
Finance Management Group:
Role: Contributor
Assigned to: grp-finance-admins
Scope: Finance Management Group (applies to all Finance subscriptions)
Result: Finance team can create/modify resources in Finance only
Engineering Management Group:
Role: Contributor
Assigned to: grp-engineering-admins
Scope: Engineering Management Group
Result: Engineering team can create/modify in Engineering only
Root Level:
Role: Owner
Assigned to: grp-operations-admins
Scope: Root (all subscriptions)
Result: IT has full control everywhere
Result
Finance VP logs in
โโ Can see Finance subscriptions โ
โโ Can create/modify Finance resources โ
โโ Cannot see Engineering subscriptions โ
โโ Cannot access Operations โ
โโ Billing isolated by department โ
Engineering VP
โโ Can see Engineering subscriptions โ
โโ Can create/modify Engineering resources โ
โโ Cannot see Finance subscriptions โ
โโ Complete isolation achieved โ
IT Director
โโ Can see ALL subscriptions โ
โโ Can manage everything โ
โโ Central oversight maintained โ
Scenario 2: Securing Development vs. Production
The Problem
TechCorp's DevOps team:
- 10 junior developers (low trust, learning)
- 5 senior developers (high trust, ship code)
- Need to prevent accidents: "Don't delete prod database by mistake"
Goal: Juniors can experiment in Dev, not touch Production.
Architecture Solution
Step 1: Create Subscriptions by Environment
Subscriptions:
โโโ Dev (dev-team can play here)
โโโ Staging (vetted changes only)
โโโ Prod (locked down, seniors only)
Step 2: Create Entra Groups
grp-junior-developers
โโโ Members: 10 junior devs
โโโ Purpose: Dev environment learning
grp-senior-developers
โโโ Members: 5 senior devs
โโโ Purpose: All environments, ship code
grp-devops-engineers
โโโ Members: 2 DevOps engineers
โโโ Purpose: Deployment and infrastructure
Step 3: Create Resource Groups with Scoped Access
DEV Subscription:
Resource Groups: rg-web-dev, rg-api-dev, rg-db-dev
Role: Contributor
Assigned to: grp-junior-developers
Result: Juniors can create/delete freely in Dev โ
STAGING Subscription:
Role: Contributor
Assigned to: grp-senior-developers + grp-devops-engineers
Result: Only seniors/DevOps can touch staging โ
PROD Subscription:
Role: Reader
Assigned to: grp-senior-developers + grp-junior-developers
Result: Everyone can VIEW prod, but only DevOps can modify โ
Role: Contributor
Assigned to: grp-devops-engineers
Result: Only DevOps can change production โ
Step 4: Add Policies to Production
Policy 1: "All PROD resources must have 'backup' tag set to 'enabled'"
Action: Deny resources without tag
Result: No backup-less prod resource can be created โ
Policy 2: "Prevent deletion of production databases"
Action: Deny delete operations on SQL databases in PROD
Result: Even DevOps must explicitly override this (audit trail) โ
Policy 3: "All PROD VMs must use premium disks"
Action: Deny VM creation with standard disks
Result: Enforce performance standards โ
Result
Junior Developer
โโ Dev: Full access (create, modify, delete) โ
โโ Staging: Read-only โ
โโ Prod: Read-only, can't change anything โ
โโ Safe to experiment without breaking prod โ
Senior Developer
โโ Dev: Full access โ
โโ Staging: Full access โ
โโ Prod: Read-only (change via DevOps) โ
โโ Peer review forced before prod changes โ
DevOps Engineer
โโ All subscriptions: Full access โ
โโ Prod changes: Recorded in audit logs โ
โโ Prod safety policies: Can override but traced โ
โโ Full control with full accountability โ
Scenario 3: Cost Control & Chargeback
The Problem
TechCorp's CFO says:
- "We're spending $50K/month on Azure, but we don't know who's spending what"
- "Engineering says they need expensive VM types, but are they really using them?"
- "We need to prevent runaway spending"
Goal: Enforce cost controls, track spending by department, prevent expensive mistakes.
Architecture Solution
Step 1: Use Tags for Cost Allocation
All resources must have tags:
โโโ CostCenter: Finance, Engineering, Operations
โโโ Environment: Dev, Staging, Prod
โโโ Owner: Department head email
โโโ Project: Name of the project/app
Step 2: Enforce Tags with Policy
Policy: "All resources must have CostCenter tag"
Action: Deny resources without CostCenter
Result: Can't spin up resources without charging them โ
Policy: "All resources must have Owner tag"
Action: Deny resources without Owner
Result: Know who to ask about each resource โ
Step 3: Use Azure Policies to Prevent Expensive Choices
Policy: "Only allow Standard_B and Standard_D VM sizes"
Action: Deny Premium VM creation
Result: Prevent expensive mistakes, force justification for exceptions โ
Policy: "Limit storage redundancy to LRS/ZRS only"
Action: Deny GRS/RA-GRS unless explicitly approved
Result: Prevent unintended expensive replication โ
Policy: "Only allow certain regions (cost optimization)"
Action: Deny resources in expensive regions
Result: "Tier 1" regions only unless justified โ
Step 4: Create Cost Anomaly Alert
Azure Cost Management Alert:
โโโ Alert when: Cost exceeds budget by 10% in any subscription
โโโ Owner: Finance team
โโโ Action: Auto-investigate, notify department head
Result
Monthly spending tracking
โโโ Finance Department: $5K (Dev/Prod accounted for)
โโโ Engineering Department: $30K (broken down by project)
โโโ Operations: $15K (infrastructure/shared)
โโโ Total: $50K with full visibility โ
Developer tries to create expensive VM
โโ Selects Premium_D64s_v3
โโ Policy blocks: "Not in allowed list"
โโ Must request exception (creates audit trail)
โโ Finance reviews justification
โโ If approved, cost charged to project/department โ
Month-end
โโโ CFO sees exact spend per department โ
โโโ Can show Finance: "You used $5K on these 12 resources"
โโโ Can challenge Engineering: "Why did you spin up
โ expensive VMs?"
โโโ Full accountability achieved โ
Scenario 4: Compliance & Audit Requirements
The Problem
TechCorp's compliance officer says:
- "We need audit trail of who accessed what"
- "All data must be encrypted at rest"
- "All data must only exist in US regions"
- "We need SOC 2 compliance"
Goal: Enforce compliance automatically, not through human checking.
Architecture Solution
Step 1: Create Compliance-Focused Policies
Policy: "All storage accounts must use encryption"
Action: Modify (auto-enable encryption if missing)
Result: Zero unencrypted storage โ
Policy: "Only allow US regions"
Action: Deny non-US regions
Result: Data residency requirement met โ
Policy: "All databases must have backup enabled"
Action: Deny DB creation without backups
Result: Recovery guaranteed โ
Policy: "All VMs must have disk encryption"
Action: Modify (auto-enable if missing)
Result: Encrypted disks everywhere โ
Step 2: Enable Auditing & Logging
All subscriptions:
โโโ Enable Activity Logs (who did what)
โโโ Enable Diagnostic Settings (resource logs)
โโโ Forward to Log Analytics Workspace
โโโ Set retention to 90 days (compliance requirement)
Step 3: Create Audit Role with Read-Only Access
Entra Group: grp-auditors
โโโ Members: Internal auditors, compliance team
โโโ Role: Reader (read-only across all subscriptions)
Result:
โโ Auditors can VIEW resources โ
โโ Auditors cannot MODIFY anything โ
โโ Auditors can query logs for investigation โ
โโ Separate audit trail of who audited what โ
Result
At audit time:
โโโ Query: "Show me all resources created in Jan-Jun"
โโโ Result: Complete list with who created them, when โ
โโโ Query: "Show me all failed login attempts"
โโโ Result: Security events visible in Activity Logs โ
โโโ Query: "Confirm all storage is encrypted"
โโโ Result: Policy compliance report shows 100% โ
โโโ Query: "Verify all data is in US regions"
โโโ Result: No resources found outside US โ
โโโ SOC 2 audit passes with evidence โ
Key Patterns
| Scenario | Management Group | RBAC | Policy | Audit |
| Delegate by Dept | By department | Scoped roles per MG | None | Standard logs |
| Dev vs Prod | By environment | Different roles per sub | Prod-specific rules | Activity logs |
| Cost Control | By department | Same across depts | Tag enforcement, VM limits | Cost mgmt alerts |
| Compliance | Central control | Auditors read-only | Encryption, region, backup | Enhanced logging, 90d retention |
How This Connects to Other Topics
Related to Module 02-05
- Identity controls everything: Every module's security starts with identity/access
- Policies prevent misconfigurations: Compliance requirements cascade into policies
- Audit trails hold people accountable: Logging enables oversight
Key Takeaways
๐ก Summary
- Delegate strategically with management groups + scoped RBAC
- Separate environments (Dev/Staging/Prod) with different permissions
- Enforce with policy (cost, compliance, standards)
- Audit everything (who did what, when, why)
- Tag for accountability (cost center, owner, project, environment)
Next Steps
- Review: Read this doc (you're here)
- Practice: Apply scenarios in Labs 02-03
- Secure: Read Identity Best Practices (hardening tactics)