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!
Try adding the SPN as a contributor or admin in the required workspaces
Yes I did make sure that the SPN is an admin in the workspace. I know that permission is good since I am able to call the connect/disconnect endpoints which require admin permissions in the workspace.