Design Enterprise Identity & Access Management
A full Staff-level walkthrough of an Entra-style enterprise identity platform — the trust root for 700M+ identities across 50M tenants — issuing OAuth/OIDC/SAML tokens at up to 500K auth/sec while staying fail-closed at five-nines. It trades global replication latency against tenant isolation, with conditional access, continuous access evaluation, and ML risk scoring sitting in the authentication hot path. Follow it top to bottom, or jump to any step.
Scope & ambiguity
Enterprise IAM is the foundation of Microsoft’s entire cloud security posture. If Entra ID authentication is down, ALL of Azure, M365, Dynamics, and every third-party app integrated via OAuth/SAML is down. This is not a feature service — it is the trust root for 700M+ identities.
3-Phase Delivery:
Team Ownership:
Key Ambiguity: 700M identities — what ratio is human vs service principal? In practice, service principals and managed identities account for ~60% of auth volume (workload identity). Service-to-service auth is 10x the volume of interactive auth with fundamentally different patterns (no MFA, shorter token lifetimes, certificate-based credentials). This shapes the entire system design.
Requirements
Functional Requirements
Non-Functional Requirements
Organizational Context: Entra ID is the most critical Azure service. Every M365 workload (Teams, Exchange, SharePoint, OneDrive) depends on it for auth. It must operate across sovereign deployments: commercial, US GCC, US GCC High, US DoD (IL5), and China 21Vianet — each with separate data boundaries and compliance regimes.
Back-of-envelope estimation
Scale Numbers
Storage Breakdown
Monthly Cost Estimate
Key Insight: Compute is the dominant cost because every auth event requires policy evaluation, risk scoring, and token issuance. However, client-side JWT validation (JWKS cached locally) eliminates 90%+ of what would otherwise be central token validation load. Without this, the system would need 10x compute.
API design
OAuth 2.0 / OIDC Endpoints (Public)
Microsoft Graph API (REST, per-tenant)
Internal gRPC Services
Data model
Storage Choice Table
Core Schemas
High-level architecture
Service-to-Team Mapping
Failure Domain Analysis
CRITICAL INSIGHT: Auth services must fail-CLOSED (deny by default), not fail-open. A fail-open auth system is a security breach. This is the opposite of most availability-focused services.
Deep dives
WHERE STAFF IS WONPartition Strategy Comparison
Hybrid approach: Large tenants get dedicated partitions (isolation + compliance). Small tenants are hash-distributed across shared partitions with logical isolation (encryption-key-per-tenant). Geographic pinning as overlay for sovereign requirements.
Directory Service at Global Scale
Authentication Protocols
Continuous Access Evaluation (CAE) — Deep Dive
Traditional token model: access tokens are valid until expiry (1 hour). If a user is disabled at minute 1, they retain access for 59 minutes. This is unacceptable for enterprise security.
CAE replaces polling-based revocation with event-driven revocation:
Conditional Access
Hybrid Identity (On-Premises AD + Cloud)
Zero Trust Token Architecture — Primary Refresh Token (PRT)
The Primary Refresh Token (PRT) is the foundation of SSO across all Microsoft services on a device. It bridges device identity with user identity.
Bottlenecks & evolution
Bottleneck Analysis
Observability
Key Metrics (all emitted per-tenant and globally):
Alerting tiers: P0 (page immediately): auth success rate <99.5% globally or <95% per-region, auth p99 >1s. P1 (page within 15 min): CA engine latency p99 >100ms, sync lag >1 hour. P2 (next business day): Identity Protection false positive rate >10%, audit log ingestion delay >15 min.
Evolution Roadmap
Rubric — Senior vs Staff
Want more breakdowns like this?
Join free early access for upcoming RAG, LLM eval, agents, and AI infrastructure walkthroughs.