Service principal
First of all, we have to create a Service Principal Name (SPN), or just service principal, which will be authenticated against our Dataverse environments.
In general, the recommendation is to use one SPN per Dataverse environment when it comes to integrations. This is so that our integration does not, by mistake, connect to the wrong environment. In the best case, a developer does not have access to the credentials for the SPN for the production environment.
Note
The Power Platform CLI also has a command to create a service principal for you. Read more at https://learn.microsoft.com/en-us/power-platform/developer/cli/reference/admin#pac-admin-create-service-principal. In addition, one could create SPNs through PowerShell as well.
When it comes to pipelines, we usually just create one SPN for a pipeline to lower the amount of SPN in Entra ID, which also makes it easier to maintain.
To create a service principal, we have to either log in to Azure Portal...