web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Importing a solution w...
Power Apps
Unanswered

Importing a solution with a Service Principal and the Power Platform CLI

(0) ShareShare
ReportReport
Posted on by 28

Hi, I am working on a project where the client has the requirement to use Service Principals instead of Service Accounts. Also we do not use Azure Devops but instead user manual solution migration between environments. In order to ensure that the solution gets imported correctly in the target environment which also incldues that the solution will be owned by a Service Principal, I would like to use the Power Platform CLI and then authenticate with the credentials of the SP. Specifically i am doing the following

1. Create an authentication with the SP credentials

pac auth create --applicationId XXXXXXXXXXXXXXXX --tenant XXXXXXXXXXXXXXXX --clientSecret XXXXXXXXXXXXXXXX

2. I then select the new authentication

pac auth select --index 2

3. I now try to list the environments that the SP has access to

pac org list

However the response is empty. No environments are listed that the SP has access to, although the SP has been added as an Application User in the PP Environment and been graned System Administrator Security Role. Also in Azure the SP has been granted according permissions:

LeoDataVinci_0-1711439000167.png

 

So the environments where the SP has been added as a user are not available when trying to list them with the PP CLI.

LeoDataVinci_1-1711439115510.png


Anybody got a hint what the issue here might be? Is there a permission missing?

Is there perhaps a workaround to do this with pipelines in managed solutions? 






 

I have the same question (0)
  • alx.kpk Profile Picture
    52 on at

    I'm facing the same issue. Seems there were problems using CLI with Service Principal also in the past:

     

    Power Platform CLI - Power Platform Community (microsoft.com)

  • tehcrash Profile Picture
    Microsoft Employee on at

    Service Principals need to be registered with BAP in order to talk to any BAP endpoint, which is the data source for the pac org list command.

     

    You can do this by running `pac admin application register --application-id [AppId]` from an admin user.   Service principals created by `pac admin create-service-principal` should also be automatically registered, but there was a now-fixed bug a several months ago that prevented that from occurring. 

     

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard