Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Service Principal setup

(1) ShareShare
ReportReport
Posted on by 4

Hello,

 

Does anyone know how to setup a Service Principal to access PowerApps in devops pipeline through connection service? Do we have to assign the Service Principal certain permissions?

 

Thank you 

  • byrnep Profile Picture
    218 on at
    Re: Service Principal setup

    Do this: https://docs.microsoft.com/en-us/power-platform/alm/devops-build-tools

     

    Worked for me.  Note that the contained script is the only way the Back Up task worked for me.  There is an API permissions set on App Reg via script that I don't think was available in the Az Portal doing it manually.

     

    What's missing is a way to assign an additional 'owner' of the flow/app when importing.  SP's as owners is less than ideal, as the Platform doesn't recognize a SP as an interactive user... you can't log in as an SP or license one.  It's intended for system to system authentication.. which is what it's doing... but.......................

  • EricRegnier Profile Picture
    8,714 Most Valuable Professional on at
    Re: Service Principal setup

    Hi @ericonline,

    To specifically answer your two questions:

    • If you want to use out-of-the-box roles, System Administrator and System Customizer roels provides privleges to export/import solutions. You can also create a new custom role with privileges to exportfor if need be and many times recommended not to provide "god" mode unnecessarily, but as @ToddShelton mentions it is common to use the System Admin roles. 
      EricRegnier_0-1651296909507.png

    • Yes, any user whether it's a standard or application user requires the right privielges (granted via security roles) to use/transact with Dataverse.

    As @ToddShelton shows, it is now much easier than before (my older post) to add new application users 🙂

    Hope this helps!

  • Cloudrocket Profile Picture
    2 on at
    Re: Service Principal setup

    Generally you assign the System Administrator security role to the Application User.  Setting up an Application User is a little different than setting up a regular user in that you need to  start from the Application Users screen (D365 Online > PP Admin Center, not Power Apps Environment Admin) > Settings > Application Users > New app user > Add an app.  Here's what it looks like on Dynamics CE server version: 9.2.22033.00156: 

     

    ToddShelton_0-1651262327818.png

    ToddShelton_2-1651262373291.png

    ToddShelton_3-1651262476184.png

    ToddShelton_4-1651262507416.pngToddShelton_5-1651262542407.png

     

    The application already has to exist in Azure Active Directory.  The AAD application has to have Dynamics CRM impersonation permissions and user permissions (you can do this administratively for everyone): 

    ToddShelton_6-1651262737297.png

     

    If you can set up your application user this way there's no username or password needed in Dynamics--adding the application as an Application User just works.  From there you can assign security roles normally. 

     

    To use this user in Azure Pipelines you map it to a Service Connection in Pipelines > Settings > Service Connections.  

     

     

  • Community Power Platform Member Profile Picture
    on at
    Re: Service Principal setup

    @EricRegnier , 

    - What CDS security role is needed for Azure DevOps to export/import a Solution?

    - Does the Service Principal need any specific permissions/roles?

  • EricRegnier Profile Picture
    8,714 Most Valuable Professional on at
    Re: Service Principal setup

    @NigelP, not quite, what I was mentioning was for Service Connections in Azure DevOps. I know in Logic Apps, you can use a client ID and secret with the Common Data Service connector but I haven't tried with canvas apps. As for Power Automate, suggest to use the Common Data Service (current environment) connector which I don't think can be used with a client ID/secret yet.

    You should submit the idea at: https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas

    Cheers

  • NPrice99 Profile Picture
    1,292 on at
    Re: Service Principal setup

    Hi @EricRegnier 

     

    Are you saying I can use ClientID and Secret for both PowerApps and PowerAutomate authentication ?

     

    Where is this documented ?

     

    Thanks

     

    Nigel

  • EricRegnier Profile Picture
    8,714 Most Valuable Professional on at
    Re: Service Principal setup

    Hi @NewcombR@cxiong,

    You can now connect with a SPN (app ID, secret) with the new Power Platform service connection type! Make sure the URL is CDS/D365 organisation URL (<name>.crm<#>.dynamics.com) and not the usual "https://management.core.windows.net/".

    I'm now using it and works like a charm!

    2020-06-07_19-27-40.png  

  • Ryan S Newcomb Profile Picture
    234 on at
    Re: Service Principal setup

    Today I noticed a new Service Principal option on the Export Solution task in the pipeline editor. (Perhaps it was there before but I didn’t notice it.)  I was able to use that option to a setup what appears to be a new service connection type specific to the Power Apps Build Tools (Before, I was using Generic service connection).  I set that up and it worked just fine.


    That new connection type option was also available for Import Solution tasks.

     

    I didn’t notice it for the environment tasks (eg reset).

  • EricRegnier Profile Picture
    8,714 Most Valuable Professional on at
    Re: Service Principal setup

    It’s setup as both

  • Ryan S Newcomb Profile Picture
    234 on at
    Re: Service Principal setup
    So you set it up as non-interactive user rather than as an application user?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 72

Overall leaderboard