<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Power BI REST API gives 403 forbidden (use service principal) in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-gives-403-forbidden-use-service-principal/m-p/2320826#M34225</link>
    <description>&lt;P&gt;"&lt;SPAN&gt;added the app (service principal) as admin in my Power BI Workspace,"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But you are using an API call against Premium workspaces.&amp;nbsp; Does your service principal have access to the Premium workspaces you are trying to access?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 05 Feb 2022 00:57:25 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2022-02-05T00:57:25Z</dc:date>
    <item>
      <title>Power BI REST API gives 403 forbidden (use service principal)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-gives-403-forbidden-use-service-principal/m-p/2317589#M34201</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get the powerbi dataset refresh history programmatically so I need to call the Power BI API using the below method,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;GET https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/refreshes&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I follow the &lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal" target="_self"&gt;MS docs&lt;/A&gt; and this&amp;nbsp;&lt;A href="https://www.datalineo.com/post/using-power-automate-to-run-dax-queries-against-your-power-bi-dataset" target="_self"&gt;guide&lt;/A&gt; and created an app on Azure, and currently I can get the access token successfully but when I run the HTTP request it return 403 forbidden error,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below is what I have tried but still the same error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I grant almost all the PBI permission to this app (both delegate and application) as figure below,&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="微信图片_20220203192955.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/664645i185E26BA280ED750/image-size/medium?v=v2&amp;amp;px=400" role="button" title="微信图片_20220203192955.png" alt="微信图片_20220203192955.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I already added the app (service principal) as admin in my Power BI Workspace,&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I also enable&amp;nbsp;&lt;STRONG&gt;Allow service principals to use Power BI APIs&lt;/STRONG&gt; in PBI Admin portal)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I have tried to call the REST API on Power BI Desktop query editor and Postman, always return forbidden error. Below screenshot is where I tried on Power BI Desktop, I also can get the access token but still 403 when I try to use the token to call API.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="微信图片_20220203195553.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/664658i41FE05EE6B4D4B95/image-size/medium?v=v2&amp;amp;px=400" role="button" title="微信图片_20220203195553.png" alt="微信图片_20220203195553.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="微信图片_20220203200013.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/664666iBACBEB839E946003/image-size/medium?v=v2&amp;amp;px=400" role="button" title="微信图片_20220203200013.png" alt="微信图片_20220203200013.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So how do I fix this? anything missing? It cost me so much time but still cannot use the API successful.&lt;/P&gt;&lt;P&gt;Any solution would be much appreciated!&lt;/P&gt;</description>
      <pubDate>Sun, 13 Feb 2022 17:43:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-gives-403-forbidden-use-service-principal/m-p/2317589#M34201</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-02-13T17:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI REST API gives 403 forbidden (use service principal)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-gives-403-forbidden-use-service-principal/m-p/2320826#M34225</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;added the app (service principal) as admin in my Power BI Workspace,"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But you are using an API call against Premium workspaces.&amp;nbsp; Does your service principal have access to the Premium workspaces you are trying to access?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Feb 2022 00:57:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-gives-403-forbidden-use-service-principal/m-p/2320826#M34225</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-02-05T00:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI REST API gives 403 forbidden (use service principal)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-gives-403-forbidden-use-service-principal/m-p/2320965#M34231</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342"&gt;@lbendlin&lt;/a&gt;&amp;nbsp;, I granted my&amp;nbsp;&lt;SPAN&gt;service principal as admin role in this premium workspace (as figure 3) so I believe it can access the content.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Feb 2022 09:03:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-gives-403-forbidden-use-service-principal/m-p/2320965#M34231</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-02-05T09:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI REST API gives 403 forbidden (use service principal)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-gives-403-forbidden-use-service-principal/m-p/2322015#M34246</link>
      <description>&lt;P&gt;Have you considered using AAD auth instead?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/migueesc123/PowerBIRESTAPI" target="_blank"&gt;migueesc123/PowerBIRESTAPI: A Microsoft Power BI Data Connector or Power Query Connector for the Power BI REST API (github.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, there's this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blog.crossjoin.co.uk/2021/08/29/connecting-to-rest-apis-with-oauth2-authentication-in-power-query-power-bi/" target="_blank"&gt;Chris Webb's BI Blog: Connecting To REST APIs With OAuth2 Authentication In Power Query/Power BI Chris Webb's BI Blog (crossjoin.co.uk)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 00:58:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-gives-403-forbidden-use-service-principal/m-p/2322015#M34246</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-02-07T00:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI REST API gives 403 forbidden (use service principal)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-gives-403-forbidden-use-service-principal/m-p/3689903#M49483</link>
      <description>&lt;P&gt;Really frustrating that the "solution" is just a pointer to a totally different type of authentication and thereby&amp;nbsp;&lt;STRONG&gt;does not resolve the posted problem at all.&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 03:52:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-REST-API-gives-403-forbidden-use-service-principal/m-p/3689903#M49483</guid>
      <dc:creator>mholloway</dc:creator>
      <dc:date>2024-02-09T03:52:38Z</dc:date>
    </item>
  </channel>
</rss>

