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

Notifications

Announcements

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
    50 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard