Forum Discussion
Graph api, keep getting "Access to the resource is forbidden"
- Anonymous1 year ago
HI Anonymous ,
Thanks for the follow-up.
You can refer to the following links for guidance on configuring Azure Key Vault for use within the Power BI Service:
Bring your own encryption keys for Power BI - Power BI | Microsoft LearnHow to access Azure KeyVault from Power BI Query t... - Microsoft Fabric Community
Re: How to access Azure KeyVault from Power BI Que... - Microsoft Fabric Community
Hope this helps. Please reach out for further assistance.
Please consider marking the helpful reply as Accepted Solution and giving kudos to assist others with similar issues.
Anonymous
I will try to suggest few approaches:
1. Power BI Web connector supports service principal authentication, which means you can enter the SPN ID, secret and tenant id in the service. This way you can avoid hard coding the credentails. Please be informed, Now, it supports aure key vault as well which means, if you want to extract the secret from key vault rather than entering directly then you can do that as well.
But I understand the fact that, if you remove the hard coded secret then you will not be able to load the queries and publish the report to the service. So I would suggest you to create a dataflow, move your queries into it. When you are trying to run the queries in a dataflow, it would prompt you to create a connection, so you can enter the details in the prompt itself. Not with in the code. Once this is done you can connect your power bi report to the dataflow. Then you will be able to publish the report.
2. You can create a custom connector which accepts service principal id , secret information and run the API calls, similar to this https://github.com/migueesc123/PowerBIRESTAPI
custom connector documentation: https://learn.microsoft.com/en-us/power-query/install-sdk
I have not tested the first approach with graph APIs, but I guess it would work. I did used SPN authetication with other API endpoint though, it worked. I tested the second approach with graph APIs as well and it was working=
Need a Power BI Consultation? Hire me on Upwork
Connect on LinkedIn
|