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

Service principals and managed identities

Choose between service principals and managed identities

An app registration creates an application object plus a tenant-local service principal. Each managed identity also creates a special service principal. The practical differences are credential ownership, caller location, lifecycle, and application capabilities.

App registration and tenant service principalManaged identity
CredentialClient secret, certificate, or federated credentialManaged by Azure — none for you to store
Direct useApplication authenticates with its configured credentialThe owning supported Azure resource obtains tokens; a user-assigned identity can also be a configured federation target
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

Deleting a resource removes its system-assigned service principal, but Azure RBAC role-assignment records are not automatically deleted with either managed-identity type. Clean up stale assignments separately.

Choosing the identity

For eligible Azure-hosted code, prefer managed identity when the app does not need user sign-in, to act as a web API, or multitenant operation. Azure manages its credential, but you still grant only the permissions it needs.

An external OIDC-capable workload does not force an app-registration service principal. Microsoft Entra workload identity federation can trust the external provider through either a user-assigned managed identity or an app registration, without a stored Entra secret. A system-assigned identity remains directly usable only by its owning Azure resource.

Primary sources

  • https://learn.microsoft.com/en-us/credentials/certifications/resources/study-guides/az-400
  • https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview
  • https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/managed-identity-best-practice-recommendations
  • https://learn.microsoft.com/en-us/entra/identity-platform/app-objects-and-service-principals
  • https://learn.microsoft.com/en-us/entra/identity-platform/security-best-practices-for-app-registration
  • https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation
All Designing and Implementing Microsoft DevOps Solutions (AZ-400) Study Resources

Related Notes

  • Agent and runner infrastructure533 words
  • Agent and runner infrastructure — quick notes222 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 levels294 words
  • Appropriate access levels — quick notes180 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.