Forum Discussion
How to connect Power BI Service to an API with separate token authentication using service principal
- 1 year ago
Hi Anonymous,
Try the below suggestion:
To avoid using an on-premises data gateway, you can use Azure Functions or Logic Apps as a secure middleware proxy. This setup allows Power BI to connect to a single, simplified public endpoint.
The Azure Function handles the complex parts: it first calls the token endpoint using client credentials, gets the access token, then makes the actual API request with the required headers, and finally returns clean JSON data to Power BI.
In Power BI, you just use a basic Web.Contents() call to the Azure Function URL with anonymous authentication, since all authentication logic is handled within the Azure Function itself. To keep it secure, you should store secrets in Azure Key Vault or the function’s App Settings, and protect the function using an API key or IP restrictions.
This method ensures secure, reliable, and gateway-free scheduled refresh in Power BI Service.
If my response was helpful, consider clicking "Accept as Solution" and give us "Kudos" so that other community members can find it easily. Let me know if you need any more assistance!
Thanks for using Microsoft Fabric Community Forum.
Hi Anonymous,
Try the below suggestion:
To avoid using an on-premises data gateway, you can use Azure Functions or Logic Apps as a secure middleware proxy. This setup allows Power BI to connect to a single, simplified public endpoint.
The Azure Function handles the complex parts: it first calls the token endpoint using client credentials, gets the access token, then makes the actual API request with the required headers, and finally returns clean JSON data to Power BI.
In Power BI, you just use a basic Web.Contents() call to the Azure Function URL with anonymous authentication, since all authentication logic is handled within the Azure Function itself. To keep it secure, you should store secrets in Azure Key Vault or the function’s App Settings, and protect the function using an API key or IP restrictions.
This method ensures secure, reliable, and gateway-free scheduled refresh in Power BI Service.
If my response was helpful, consider clicking "Accept as Solution" and give us "Kudos" so that other community members can find it easily. Let me know if you need any more assistance!
Thanks for using Microsoft Fabric Community Forum.
- v-sgandrathi1 year ago
Community Support
Hi Anonymous,
Since we haven't heard back from you yet, I'd like to confirm if you've successfully resolved this issue or if you need further help?
If you've already resolved the issue, you can mark the helpful reply as a "solution" so others know that the question has been answered and help other people in the community. Thank you again for your cooperation!
If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.Thank you.