Before we register anything or create credentials, let’s review what a service principal actually is and why automation needs one.
Think of a service principal (SPN) as a robot user. It has its own identity, its own credentials, and its own permissions – but there’s no human behind it. It logs in, does its job, and never forgets a step. This user, called an S2S User in Dataverse, allows a non-person account to log in and have access to APIs and various other resources. S2S means server-to-server so this is created for non-human actors to perform various tasks ( meaning automations ) with no UI component.
In the LCS world, you log into the portal with your personal or service account to deploy packages. That works when one person deploys once a month. But what happens when you’re on vacation? Or when you want deployments to happen automatically at 2 AM after a build completes? You need an identity that doesn’t take holidays. Some automations are available for LCS but they require an account that could have a UI component and they cannot have MFA enabled. The limitations around MFA typically make use of the LCS APIs limited for security focused organizations.
That’s what a service principal is: an identity purpose-built for automation.
You could store your own credentials in the pipeline, but that’s a bad idea:
A service principal has exactly the permissions it needs and nothing more.
To work with D365 Finance and Operations pipelines, your service principal needs three registrations:
Entra ID App Registration – This creates the identity itself. Think of it as the robot’s birth certificate. You get back a Client ID (the robot’s username) and a Client Secret (the robot’s password). todo link here.
PPAC Management App Registration – Entra ID knows the robot exists, but Power Platform doesn’t trust it yet. This step tells PPAC: “this robot is allowed to call admin APIs – provision environments, deploy packages, copy databases.” Without this, the SPN gets “Access Denied” on every PPAC call.
F&O Application User – If your pipelines need to call F&O APIs directly (OData endpoints, Data Management Framework), the SPN must also be registered inside each F&O environment as an application user with appropriate security roles. This will allow for automation to trigger various activities via API in F&O such a data entity refresh after copying a database.
In the LCS world, here’s what you did manually:
In the PPAC world, the service principal does the equivalent:
Same outcome, different actor. The SPN is just doing what you used to do – but programmatically, reliably, and without needing a human present.
The client secret is essentially the SPN’s password. It’s a long random string that proves “I am this service principal.” Like any password, it expires (typically every 12 months) and must be rotated. Unlike your password, it never gets typed into a browser – it lives in a secure variable group that only authorized pipelines can read. We’ll talk more about variable groups later. Additionally, you can use certificate based authentication as well. Conceptually replace secret with a certificate thumbprint and the concepts are the same. I’ll be talking about creating and using a secret but if you replace “secret” with “thumbprint”, we’re using the mental model for certificate based auth. Regardless of the way we authenticate, both secrets and certificates need to be rotated. First, they expire and it’s best practice to have expiry in your security plan. Second, sometimes ( hopefully very rarely ) credentials can be exposed and value has to be removed/deleted and new ones used in their place.
Now that you understand what a service principal is and why it exists, the next article will walk you through creating one step by step – registering the app in Entra ID, adding the PPAC management registration, and setting up the F&O application user.
Original Post https://www.atomicax.com/content/2-what-service-principal