System-assigned vs user-assigned managed identities, workload identity federation and when to use each.
From Ultra Transcenders AZ-305 by Tony Rough (publishing soon)
Workloads need identities too, and the safest credential is one you never handle. Managed identities give Azure compute an identity whose secret the platform manages, while service principals remain for code that runs outside Azure.
| Identity | Lifecycle and sharing | Pick when |
|---|---|---|
| System-assigned managed identity | Created and deleted with one resource, so ten VMs get ten identities | Credentials must be tied to a single service instance |
| User-assigned managed identity | A standalone resource that can be attached to many resources. Grant its roles once | A growing set of VMs or apps must share one identity with no new role assignments |
| Service principal (app registration with a secret or certificate) | The credential must be stored and rotated, and can be copied | Code running outside Azure, for example a Databricks service principal for on-premises apps |
Common trap: Choosing a service principal when credentials must be tied to one service instance — its secret can be copied and shared; use a system-assigned managed identity.
Common trap: Choosing system-assigned identities for an app that runs across several VMs — that creates one identity per VM, each needing its own role assignments; use a user-assigned identity.
Figure 1.3 traces the token request step by step.
http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://vault.azure.net, with the header Metadata: true.login.microsoftonline.com) is for app registrations that authenticate with their own secret or certificate.Common trap: Requesting a VM’s managed-identity token from the Microsoft identity platform (Entra ID token endpoint) — managed-identity tokens come from IMDS on the VM.
For Databricks, personal access tokens belong to individual users and must be replaced when staff leave. Managed identities work only for code running on Azure, which is why on-premises callers use a Databricks service principal.
This note is one section of Ultra Transcenders AZ-305: Designing Microsoft Azure Infrastructure Solutions, an independent study guide that explains every topic the exam covers by technology, with comparison tables, diagrams and the common traps, plus a glossary linked to Microsoft Learn.
Publishing soon on Amazon in Kindle and paperback editions.
About the book · Free AZ-305 glossary · All AZ-305 study notes
Choosing a redundancy option for durability and availability targets, and what customer-managed account failover does.
How to pick between Azure SQL Database, Azure SQL Managed Instance and SQL Server on Azure VMs from compatibility and management requirements.
Zone redundancy, active geo-replication and failover groups for Azure SQL, with the RPO and RTO each design gives.
A decision guide to Azure compute services by control, scale and operational effort.
How private endpoints and service endpoints differ, and how to design private DNS for hybrid networks.
Choosing between Azure's global and regional, layer 4 and layer 7 load-balancing services.
The five Cosmos DB consistency levels, what each guarantees, and the latency and availability trade-offs.