Forum Discussion
Unknown Error when calling the initializeConnection Fabric Git API endpoint with a service principal
- 1 year ago
With some great help from Microsoft we finally figured out the solution. It was a combination of three items that we had to solve. The first item was in the Fabric Admin Portal. We had to enable the following setttings:
- Service principals can access read-only admin APIs
- Service principals can access admin APIs used for updates
In addition these settings the second item that is required is that you put your service principal into an Entra AD group:
The second thing we had to do was reconfigure our service principal setup in the app registration. In my own troubleshooting I had added several Fabric/PowerBI related API permissions. As mentioned in this document: Embed Power BI content with service principal and an application secret
These permissions are no longer needed once you enable the Fabric API setting and in fact can cause issues. See this callout:
The solution was to remove all of the permissions besides the default one you get when you create an app registration:
After doing these 3 steps we are now able to sync our workspaces with GIT via a service principal inside of GitHub Actions workflow. As a bonus it also supports using federated credentials instead of having to rely on a client secret!
I only see the following 4 permissions under PowerBI Service for the app registration:
I did add all 4 of these and granted admin consent. Additionally I updated my GitHub Actions permissions and made sure that the workspace was disconnected before running again. I am still getting the same error however.
Hi ckingdon_bee ,
Thank you for your response!!
Can you please raise a Microsoft support ticket for further investigation. You can create a Microsoft support ticket using the link below.
How to create a Fabric and Power BI Support ticket - Power BI | Microsoft Learn
If this helps, then please Accept it as a solution and dropping a "Kudos" so other members can find it more easily.
Hope this works for you!
Thanks & Regards,
Rekha,
Cummunity Support Team.