<?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 API using Service Principal in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Power-BI-API-using-Service-Principal/m-p/4247352#M4675</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/701977"&gt;@FabianSchut&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The bearer token was obtained using the clien_sercet method. and I use scope '&lt;A href="https://analysis.windows.net/powerbi/api/.default" target="_blank"&gt;https://analysis.windows.net/powerbi/api/.default&lt;/A&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="minhee_0-1729210668786.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1185041i314E81BE16A78FEF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="minhee_0-1729210668786.png" alt="minhee_0-1729210668786.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Oct 2024 00:23:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-10-18T00:23:16Z</dc:date>
    <item>
      <title>Power BI API using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Power-BI-API-using-Service-Principal/m-p/4245591#M4653</link>
      <description>&lt;P&gt;Hi, I am not sure if this is the right category to post since i am not a Fabric user but only Power BI. if not, my bad &lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;i am trying to use Power BI API via Service principal. i've given delegated permissions to the service principal and also enabled all the settings in Power BI's Admin Portal setting relevant. details as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- APIs&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; - Got my token as following to '&lt;A href="https://api.powerbi.com/v1.0/myorg/groups/{group_id}/datasets/{dataset_id}/refreshes" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/groups/{group_id}/datasets/{dataset_id}/refreshes&lt;/A&gt;'&amp;nbsp; &amp;nbsp; (get)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; - Get Power BI Dataset Refresh history&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; : '&lt;A href="https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token" target="_blank" rel="noopener"&gt;https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token&lt;/A&gt;'&amp;nbsp; &amp;nbsp; (post)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; - GET Sharepoint Data&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; :'&amp;nbsp;&lt;A href="https://accounts.accesscontrol.windows.net/[Tenant-ID]/tokens/OAuth/2" target="_blank" rel="noopener"&gt;https://accounts.accesscontrol.windows.net/[Tenant-ID]/tokens/OAuth/2'&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(post)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Power BI Workspace : Added a security group the service principal is in as Admin. in case it might help, i also added the service principal itself as admin, too...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Delegated permission&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;Power BI&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; - Dataset.readwrite.all&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; - Item.Excute.ALL&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; - Item.ExternalDataShare.ALL&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; - Item.ReadWrite.ALL&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; - Item.Reshare.ALL&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; -App.Read.All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;lt;Sharepoint&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;- AllSites.Read&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;- AllSites.Write&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The thing is that even all these settings added and enabled, i still get errors,,,, is anyone know how i can resolve this?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="minhee_2-1729125621363.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1184325i87B8DDCCD7B25A0F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="minhee_2-1729125621363.png" alt="minhee_2-1729125621363.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="minhee_0-1729125455286.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1184321i37261AA1016FBAC1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="minhee_0-1729125455286.png" alt="minhee_0-1729125455286.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="minhee_1-1729125457985.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1184322iC9206F88466302F6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="minhee_1-1729125457985.png" alt="minhee_1-1729125457985.png" /&gt;&lt;/span&gt;&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;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;P.S. I succeeded testing the same senario in Different Tenant. therefore, it could be something to do with conditional access?&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 01:11:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Power-BI-API-using-Service-Principal/m-p/4245591#M4653</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-17T01:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI API using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Power-BI-API-using-Service-Principal/m-p/4245870#M4656</link>
      <description>&lt;P&gt;Hi @Anonymous&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What method do you use to get the Bearer token? Do you use the client_id &amp;amp; client_secret version? What is the scope you are using while retrieving the Bearer token?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 05:24:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Power-BI-API-using-Service-Principal/m-p/4245870#M4656</guid>
      <dc:creator>FabianSchut</dc:creator>
      <dc:date>2024-10-17T05:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI API using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Power-BI-API-using-Service-Principal/m-p/4246036#M4660</link>
      <description>&lt;P&gt;Just want to mention:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you are using service principal (or more precisely: client credentials flow), the delegated permissions have no effect. So it's not necessary to setup any delegated permissions when you will use the service principal authentication (more specifically, client credentials flow).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What matters, is what permissions you give the service principal inside the Power BI portal (Fabric).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/answers/questions/2039779/service-principal-doesnt-respect-delegated-permiss" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/answers/questions/2039779/service-principal-doesnt-respect-delegated-permiss&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/General-Discussion/Power-BI-Rest-API-Delegated-permissions-vs-Service-principal/m-p/4133831" target="_blank" rel="noopener"&gt;https://community.fabric.microsoft.com/t5/General-Discussion/Power-BI-Rest-API-Delegated-permissions-vs-Service-principal/m-p/4133831&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.reddit.com/r/PowerBI/s/ZhJFNHA7vM" target="_blank" rel="noopener"&gt;https://www.reddit.com/r/PowerBI/s/ZhJFNHA7vM&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 10:05:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Power-BI-API-using-Service-Principal/m-p/4246036#M4660</guid>
      <dc:creator>frithjof_v</dc:creator>
      <dc:date>2024-10-17T10:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI API using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Power-BI-API-using-Service-Principal/m-p/4247352#M4675</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/701977"&gt;@FabianSchut&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The bearer token was obtained using the clien_sercet method. and I use scope '&lt;A href="https://analysis.windows.net/powerbi/api/.default" target="_blank"&gt;https://analysis.windows.net/powerbi/api/.default&lt;/A&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="minhee_0-1729210668786.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1185041i314E81BE16A78FEF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="minhee_0-1729210668786.png" alt="minhee_0-1729210668786.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 00:23:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Power-BI-API-using-Service-Principal/m-p/4247352#M4675</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-18T00:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI API using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Power-BI-API-using-Service-Principal/m-p/4247609#M4679</link>
      <description>&lt;P&gt;Hi @Anonymous&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Those are indeed the correct settings. Are you sure that the service principal is added as a member in the security group app-test-mhkim (the security group that is able to use APIs)? And just to be sure, in your screenshot you have unapplied changes for the admin API settings. Did you apply them afterwards?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 05:11:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Power-BI-API-using-Service-Principal/m-p/4247609#M4679</guid>
      <dc:creator>FabianSchut</dc:creator>
      <dc:date>2024-10-18T05:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI API using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Power-BI-API-using-Service-Principal/m-p/4248016#M4684</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply from FabianSchut&amp;nbsp;and&amp;nbsp;frithjof_v,&amp;nbsp;FabianSchut&amp;nbsp;gave the suggetions, you can check it.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P style="text-align: justify; text-justify: inter-ideograph;"&gt;&lt;SPAN&gt;Best Regards,&lt;BR /&gt;Yang&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Community Support Team&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 09:21:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Power-BI-API-using-Service-Principal/m-p/4248016#M4684</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-18T09:21:36Z</dc:date>
    </item>
  </channel>
</rss>

