Forum Discussion
Service principal for dataset datasource credential
- 1 year ago
Hi msprog,
Apologize for the inconvenience caused. Thank you for your follow-up, that is a good question. We acknowledge that this limitation is not clearly documented at present.While Power BI Service does let you enter Service Principal details (like tenant ID, client ID, and secret) in the credentials dialog, it’s important to note that not all connectors support SPN-based authentication behind the scenes.
In your case, both the Web and SharePoint Folder connectors rely on delegated OAuth2, which means they expect a signed in user contex.
If using a Service Principal is a must for your scenario, here are a couple of potential workarounds:
- Use the Microsoft Graph API in combination with Web.Contents() and an access token obtained via the client credentials flow (SPN). This would require setting up a gateway to support the refresh in Power BI Service.
- Alternatively, you could build a custom connector that securely handles SPN token acquisition and integrates with your data source.
Kindly refer to the below mentioned documentation links:
OAuth 2.0 client credentials flow on the Microsoft identity platform - Microsoft identity platform | Microsoft Learn
Web.Contents - PowerQuery M | Microsoft LearnIf you have any questions, please do not hesitate to contact us, and we will be happy to assist you.
Thank you for using the Microsoft Community Forum.
Hi. Many users are talking about this issue, but I have only seen one person talking about a possible solution. He mentions that
Setting the property "DisableCustomAppAuthentication" in your SharePoint tenant to "false" is doing the trick
You can read the whole conversation here: https://community.fabric.microsoft.com/t5/Service/Adding-a-SharePoint-data-source-with-a-service-principal/td-p/3791170
In addition, this is being investigated by microsoft. You can add information in the issue conversation here: https://community.fabric.microsoft.com/t5/Issues/Connect-to-Sharepoint-with-Service-Principal/idi-p/3968004
I hope that helps,