<?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: Cannot list Dataflows as Admin via Service Principal in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Cannot-list-Dataflows-as-Admin-via-Service-Principal/m-p/3828933#M51702</link>
    <description>&lt;P&gt;HI&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;
&lt;P&gt;Have you take a look at the official document about how to use service principal with power bi rest api and its usage limitations? If not, I'd like to suggest you check them at first.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal#considerations-and-limitations" 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;Regards,&lt;BR /&gt;Xiaoxin Sheng&lt;/P&gt;</description>
    <pubDate>Thu, 11 Apr 2024 03:00:59 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-04-11T03:00:59Z</dc:date>
    <item>
      <title>Cannot list Dataflows as Admin via Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Cannot-list-Dataflows-as-Admin-via-Service-Principal/m-p/3827678#M51692</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I encountered a very weird situation today. My goal is to get a list of all dataflows in my tenant via the API (GetDataflowsAsAdmin) using a service principal / azure App.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For this I&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;registered an app in azure&lt;/LI&gt;&lt;LI&gt;did not give any permissions (especially non that need admin consent)&lt;/LI&gt;&lt;LI&gt;added said app/service principal to an Entra-ID-Group which is allowed to call the read-only admin API ("Service principals can access read-only admin APIs"). This is set in the PowerBI admin portal&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Now, using python, I wanted to get the list of all dataflows but I get an 401 Unauhtorized and I am not sure why, since a lot of other admin APIs do work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E.g. I can query the following and get results back:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://api.powerbi.com/v1.0/myorg/admin/dataflows?$top=100" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/admin/groups?$top=100&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://api.powerbi.com/v1.0/myorg/admin/dataflows?$top=100" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/admin/datasets?$top=100&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://api.powerbi.com/v1.0/myorg/admin/reports?$top=100" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/admin/reports?$top=100&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;But&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://api.powerbi.com/v1.0/myorg/admin/dataflows?$top=100" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/admin/dataflows?$top=100&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;does not work (unauhtorized).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Does my service principal need additional permission just for dataflows? I could not get any information from the docs...so perhaps someone here knows more.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FYI: I first get an access token via msal for&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;authority&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;A href="https://login.microsoftonline.com/" target="_blank"&gt;https://login.microsoftonline.com/&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;tenant_id&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;scope&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; [&lt;/SPAN&gt;&lt;SPAN&gt;'&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;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Sven&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 10 Apr 2024 13:37:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Cannot-list-Dataflows-as-Admin-via-Service-Principal/m-p/3827678#M51692</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-10T13:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot list Dataflows as Admin via Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Cannot-list-Dataflows-as-Admin-via-Service-Principal/m-p/3828933#M51702</link>
      <description>&lt;P&gt;HI&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;
&lt;P&gt;Have you take a look at the official document about how to use service principal with power bi rest api and its usage limitations? If not, I'd like to suggest you check them at first.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal#considerations-and-limitations" 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;Regards,&lt;BR /&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 03:00:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Cannot-list-Dataflows-as-Admin-via-Service-Principal/m-p/3828933#M51702</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-11T03:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot list Dataflows as Admin via Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Cannot-list-Dataflows-as-Admin-via-Service-Principal/m-p/3829451#M51704</link>
      <description>&lt;P&gt;Thank you for your answer! Seems like I missed that article as I didn't think my problem had something to do with embedding.&lt;/P&gt;&lt;P&gt;It would be nice if there were some tags or markers that show which API is supported for service principals and which are not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case it seems that I will have to use my own account.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sven&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 05:59:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Cannot-list-Dataflows-as-Admin-via-Service-Principal/m-p/3829451#M51704</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-11T05:59:21Z</dc:date>
    </item>
  </channel>
</rss>

