FREE STUDY NOTES · AZ-305

Managed identities and workload credentials in Azure

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.

How managed identities authenticate

Figure 1.3 traces the token request step by step.

App code on a VM or App Service requests a token from the local identity endpoint (IMDS at 169.254.169.254 on a VM), which obtains an app-only token from Microsoft Entra ID; the app then calls Key Vault, Storage or SQL, which accept it when the identity has been granted a role. A side panel contrasts a system-assigned identity (one per resource) with a user-assigned identity shared by many VMs.
Figure 1.3: How a managed identity gets and uses a token

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.

Databricks credentials

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.

Get the whole book

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.

Amazon.co.ukKindle: coming soonPaperback: coming soon
Amazon.comKindle: coming soonPaperback: coming soon

Publishing soon on Amazon in Kindle and paperback editions.

About the book · Free AZ-305 glossary · All AZ-305 study notes

More AZ-305 study notes