Diagram
A decision tree that helps choose between a Managed Identity and a Service Principal based on where the application runs and whether Azure can manage credentials automatically.
Choosing the Right Option
The choice depends on where your application runs and how much control you need. Use a Service Principal when your application runs on-premises or on another cloud platform, when you need to grant permissions to multiple resources with different access levels, or when your security policy requires you to manage and audit credentials explicitly. Use a Managed Identity when your application runs on an Azure service that supports it, because the platform handles credential management for you and reduces the chance of accidental exposure. In Azure DevOps pipelines, both types can authenticate to Azure, but Managed Identities offer a safer default because they leave no secrets in pipeline configuration files.
Domain 1 of 3
19 practice questions
Practice this DomainLast updated