BrainyBeeBrainyBee
ExploreBlogStart Studying
HomeDesigning and Implementing Microsoft DevOps Solutions (AZ-400)Service principals and managed identities
Lesson256 words

Service principals and managed identities

Choose between service principals and managed identities

Both are Microsoft Entra identities an application can authenticate as. The difference is who manages the credential.

Service principal (app registration)Managed identity
CredentialSecret or certificate you create, store and rotateManaged by Azure — none for you to store
Works fromAnywhereOnly from a supported Azure resource
LifecycleIndependent of any resourceTied to the resource (system-assigned) or standalone (user-assigned)

System-assigned versus user-assigned

System-assignedUser-assigned
LifecycleCreated with the resource, deleted with itStandalone; survives resource deletion
SharingOne resource onlyShared across many resources
Use whenA single resource needs its own identitySeveral resources need the same role assignments

The exam framing is usually one of two shapes: "identity must be cleaned up automatically with the resource" → system-assigned; "ten VMs need identical access and I do not want ten sets of role assignments" → user-assigned.

The rule of thumb

Prefer a managed identity wherever the workload runs on an Azure resource that supports one, because there is no secret to leak, rotate or expire. Reach for a service principal when the caller is outside Azure — a GitHub Actions runner, an on-premises agent, a third-party service — and then prefer workload identity federation so even that has no stored secret.

Primary sources

  • https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview
  • https://learn.microsoft.com/en-us/entra/identity-platform/app-objects-and-service-principals
All Designing and Implementing Microsoft DevOps Solutions (AZ-400) Study Resources

Related Notes

  • Agent and runner infrastructure421 words
  • Agent and runner infrastructure — quick notes150 words
  • Alerting on pipeline events255 words
  • Alerting on pipeline events — quick notes94 words
  • Analyzing usage and application performance241 words
  • Analyzing usage and application performance — quick notes73 words
  • Appropriate access levels217 words
  • Appropriate access levels — quick notes85 words
  • Automating container scanning277 words
  • Automating container scanning — quick notes96 words
  • Automating documentation from Git history191 words
  • Automating documentation from Git history — quick notes55 words

Ready to study Designing and Implementing Microsoft DevOps Solutions (AZ-400)?

Practice tests, flashcards, and all study notes — free, no sign-up.

Start Studying

Ready to study Designing and Implementing Microsoft DevOps Solutions (AZ-400)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free
Designing and Implementing Microsoft DevOps Solutions (AZ-400) ResourcesExplore All HivesBlogHome

© 2026 BrainyBee. Free AI-powered exam prep.