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.
Thanks for this input v-kpoloju-msft ,
Is there any MSFT doc that clearly mentions this limitation with Web and Sharepoint folder connector? if there is, can you please point me to that,
Also you mention that Currently, the credential dialog in Power BI Service does not support entering a client ID/secret for app-only access. Sorry what do you mean by this?, I can enter values for tenant id, Service Principal Id and Service Principal key. Please can you explain
thanks
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 Learn
If 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.
- v-kpoloju-msft1 year agoCommunity Support
Hi msprog,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.