Showing results for 
Search instead for 
Did you mean: 

Using Service Principal in Power Automate/Flow

Any CDS trigger or action requires a connection to CDS environment.

While adding connection, we can choose to sign in with individual user account or Service Principal.

If we choose to sign in with individual user , CDS action runs in that user context and in auditing it shows as the user performed that action.

It may cause problems in some scenarios like audit checks/troubleshooting.

So better way to do it is sign in with service principal / application user. By creating service principal, we are indirectly creating an identification for the flow.

A service principal is created by registering an Azure AD application and then creating a corresponding application user in CDS.

When you use an application user/service principal on the CDS connector all actions are performed by that user on behalf of organization users who are triggering the flow by performing some action (Which is called impersonation ).

Application users get the permissions from the security roles associated with the CDS app user. 

Below steps are required to create Service Principal / Application user.

Step 1: Register your application in Azure Active Directory.

Refer this article from Microsoft docs to create application in Azure AD. And note down client id/application id, client secret , tenant id .

Step 2 : Create application user in CDS environment and assign security role(custom).

Refer this article from Microsoft docs to create application user and assign security role.

Step 3: Add new connection and sign in with service principal in flow.





Enter client id/application id, client secret, tenant/directory id that we got from Step 1 and click on create.


That’s it .

Hope it helps.

Original post from my blog :


Meet Our Blog Authors
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • Cambridge UK Power Platform User Group Leader, Technical evangelist and speaker. Always says yes to coffee! #LetsGetCoffee
  • Passionate #Programmer #SharePoint #SPFx #Office365 #MSFlow | C-sharpCorner MVP | SharePoint StackOverflow, Github, PnP contributor
  • I am building business processes and applications that are easy for users' to stick to, so they can follow and understand them. In overall I transform processes to be more reliable and effortless. I am a proud co-organizer of SharePoint Saturday Warsaw and active community member, blogger and international speaker.