Implement Microsoft Entra ID service principals

Completed

Unit 4 closed with one problem left unsolved: Contoso's equipment-provisioning flow and the reusable child flows it calls still depend on the account of whoever built them. That ownership model fails the moment that person's role changes, their license lapses, or they leave the company. This unit replaces that fragile dependency with a non-human identity that keeps the flow running independent of any one person's employment status.

Give automation its own identity, not a person's

A service principal is a non-human security identity that represents an application or service rather than a person. Registering an application in Microsoft Entra ID creates two linked objects. An application object is the global template for the app that lives in its home tenant.

A service principal is the local instance of that app inside a specific tenant that actually authenticates and acts. In that tenant, the service principal defines the access policy and permissions the application has when it authenticates and accesses resources.

Diagram of a Microsoft Entra ID app registration becoming a service principal, then a Dataverse application user.

That distinction matters for Contoso's flow. Today, every run of the provisioning flow authenticates as an individual maker, so the flow's identity disappears the moment that maker's account does. A flow owned by a service principal instead authenticates as the application, something that exists independent of who's currently employed at Contoso.

This application-object-and-service-principal pattern isn't specific to Power Automate. It secures automation across Microsoft Entra ID, Azure, and the wider Power Platform. That's part of why it's the standard answer to an ownership problem, rather than a workaround built just for flows.

Decide when ownership should move to a service principal

Not every flow needs this change. A service principal earns its place for flows Contoso genuinely can't afford to lose: ones that service a department or the whole business rather than one person's personal task list.

Recall the ownership failure from the Introduction: the provisioning flow stopped the moment its original maker left Contoso, because every run authenticated as that person. No individual's account is a safe permanent anchor for a mission-critical process.

A service principal insulates ownership from exactly the events that caused that failure: a role change that moves someone off the flow, a premium license that gets unassigned, and a departure that removes the account entirely. None of those events touch the service principal, because it was never tied to a single person's employment status in the first place.

Service-principal ownership also suits organizations that move the provisioning flow and its child flows through development, test, and production environments in a DevOps-style pipeline. In that pattern, the goal is for flow ownership to stay consistent across environments rather than depend on whichever person performs deployment work that day. A service principal gives Contoso that stable owner across environments.

Make a service principal usable through an application user

A service principal exists in Microsoft Entra ID, but a Dataverse environment doesn't recognize Entra identities directly; it needs a user record of its own. The bridge between the two is an application user: a Dataverse record that represents a registered Entra application inside a specific environment. You create it and assign security roles and a business unit in the Power Platform admin center, in roughly the same way an administrator sets up a human user.

You explore how an application user differs from a human one in a key respect: it's unlicensed and non-interactive, meaning it never signs in through a browser or app the way a person does. It exists only so Microsoft Entra ID can authenticate the application's automated calls into Dataverse.

An environment supports only one application user per registered Entra application. Contoso creates a single application user to represent the service principal it plans to use, not one per flow that service principal eventually owns.

What changes once a service principal owns the flow

Moving ownership to a service principal reaches into several settings beyond a single field. The most direct change happens in the flow's Details pane, where editing the Owner setting replaces the departing maker's name with the application user instead of another person.

For a flow built outside a solution, Contoso also needs to explicitly share the flow's connections with that application user, because ownership alone doesn't carry connection access with it. A flow built inside a solution skips that extra step, since solution flows handle connection sharing as part of the solution itself.

Licensing changes shape, too. You can't assign a license directly to a non-interactive identity. Instead, a premium flow owned by a service principal draws on one of three sources. These are a Power Automate Process or per-flow license assigned to the flow, a flow group's shared license capacity, or a designated licensed user whose entitlement the flow runs under.

One constraint is worth remembering regardless of which licensing path Contoso chooses: a service principal can own a flow outright, but it can't be added as a co-owner alongside a person, so this change replaces ownership rather than adding to it.

Aspect Human-owned flow Service-principal-owned flow
Ownership stability Tied to one person's account and employment status Independent of any individual's role, license, or tenure
Sign-in behavior Owner can sign in interactively Application user never signs in directly
Licensing Covered by the owner's assigned license Process/per-flow license, flow group capacity, or a designated user's entitlement

Learn more about service principal support for owned flows, including request-limit and licensing details beyond this unit's scope.

Reflect: Across this module, Contoso's provisioning flow faced five separate failures: malformed data, a flaky availability service, over-triggering on every edit, duplicated approval logic, and ownership tied to one person. Match each failure to the technique that resolved it, then consider specifically how a service principal closes that last one in a way expressions, retry policies, or child flows couldn't.

Expressions and controlled branching now handle bad data. Retry policies and trigger conditions keep the flow from failing or firing needlessly. A reusable child flow holds shared approval logic in one place, and a service principal keeps ownership intact. Contoso's provisioning flow no longer depends on favorable conditions, or on any one person, to keep running.