<?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 ADMIN Rest API request using Service Principal in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/ADMIN-Rest-API-request-using-Service-Principal/m-p/2944872#M40096</link>
    <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use ADMIN REST API for Power BI (e.g., GetGroupsAsAdmin) using a Service Principal (Read-Only).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have follow the MS documentation for this process:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Create App in Azure (Without any PBI Admin-consent credential)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Add the App into a Secure Group in Azure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Enable the Service Principal in Power BI and add the Secure Group as an specific group&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. Add the App as a member of the workspaces in Power BI Service&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I generate the access token in PowerShell and try to pull out data from REST API using Anonynous connection in Power BI Desktop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yet I was getting a forbidden access message...&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="sebastianj_0-1669991832892.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/834376i7A045DCFBB6E5D5A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sebastianj_0-1669991832892.png" alt="sebastianj_0-1669991832892.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="sebastianj_1-1669991905097.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/834377i96921AA29AC8791D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sebastianj_1-1669991905097.png" alt="sebastianj_1-1669991905097.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then we allow the Delegated Permission (Tenant.ReadAll) but message just changed to "Credential provided are not valid"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know what could be happening?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Dec 2022 14:42:42 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-12-02T14:42:42Z</dc:date>
    <item>
      <title>ADMIN Rest API request using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/ADMIN-Rest-API-request-using-Service-Principal/m-p/2944872#M40096</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use ADMIN REST API for Power BI (e.g., GetGroupsAsAdmin) using a Service Principal (Read-Only).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have follow the MS documentation for this process:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Create App in Azure (Without any PBI Admin-consent credential)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Add the App into a Secure Group in Azure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Enable the Service Principal in Power BI and add the Secure Group as an specific group&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. Add the App as a member of the workspaces in Power BI Service&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I generate the access token in PowerShell and try to pull out data from REST API using Anonynous connection in Power BI Desktop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yet I was getting a forbidden access message...&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="sebastianj_0-1669991832892.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/834376i7A045DCFBB6E5D5A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sebastianj_0-1669991832892.png" alt="sebastianj_0-1669991832892.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="sebastianj_1-1669991905097.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/834377i96921AA29AC8791D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sebastianj_1-1669991905097.png" alt="sebastianj_1-1669991905097.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then we allow the Delegated Permission (Tenant.ReadAll) but message just changed to "Credential provided are not valid"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know what could be happening?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 14:42:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/ADMIN-Rest-API-request-using-Service-Principal/m-p/2944872#M40096</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-02T14:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: ADMIN Rest API request using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/ADMIN-Rest-API-request-using-Service-Principal/m-p/2945604#M40102</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;- you shouldn't need step 4.&amp;nbsp; The Service Principal app will be assigned premissions to read all workspaces when the Security Group it is a member of was added in step 3.&amp;nbsp; However, can I please check that you added it in the 2 places in the Power BI Tenant Settings:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Allow service principals to use Power BI APIs&lt;/LI&gt;
&lt;LI&gt;Allow service principals to use read-only Power BI admin API&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal#step-3---enable-the-power-bi-service-admin-settings" target="_blank"&gt;Embed Power BI content in an embedded analytics application with service principal and an application secret - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/enterprise/read-only-apis-service-principal-authentication" target="_blank"&gt;Enable service principal authentication for read-only admin APIs - Power BI | Microsoft Learn&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 22:42:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/ADMIN-Rest-API-request-using-Service-Principal/m-p/2945604#M40102</guid>
      <dc:creator>Daryl-Lynch-Bzy</dc:creator>
      <dc:date>2022-12-02T22:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: ADMIN Rest API request using Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/ADMIN-Rest-API-request-using-Service-Principal/m-p/2953294#M40172</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;If these also don't help, please share more detailed information to help us clarify your scenario to test.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 07:31:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/ADMIN-Rest-API-request-using-Service-Principal/m-p/2953294#M40172</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-07T07:31:18Z</dc:date>
    </item>
  </channel>
</rss>

