<?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: Issue with Power BI API Permissions for Datasets - 401 Unauthorized &amp;quot;PowerBINotAuthorizedEx in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Issue-with-Power-BI-API-Permissions-for-Datasets-401/m-p/5190323#M65152</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1598205"&gt;@Xiaolingwh&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We’d like to follow up regarding the recent concern. Kindly confirm whether the issue has been resolved, or if further assistance is still required. We are available to support you and are committed to helping you reach a resolution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 29 May 2026 05:51:21 GMT</pubDate>
    <dc:creator>v-echaithra</dc:creator>
    <dc:date>2026-05-29T05:51:21Z</dc:date>
    <item>
      <title>Issue with Power BI API Permissions for Datasets - 401 Unauthorized "PowerBINotAuthorizedException"</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Issue-with-Power-BI-API-Permissions-for-Datasets-401/m-p/5188400#M65139</link>
      <description>&lt;P&gt;I am encountering an issue accessing the endpoints for reports and datasets in the Power BI API.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I generate the access token with:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; “auth_url” :&amp;nbsp;&amp;nbsp; &lt;A href="https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0/token" target="_blank"&gt;https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0/token&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; grant_type": client_credentials,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; "client_id": CLIENT_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "client_secret": CLIENT_SECRET,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "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;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Test in postman.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;GET &lt;A href="https://api.powerbi.com/v1.0/myorg/groups/%7bWORKSPACE_ID%7d/datasets" target="_blank"&gt;https://api.powerbi.com/v1.0/myorg/groups/{WORKSPACE_ID}/datasets&lt;/A&gt; - Successfully&lt;/LI&gt;&lt;LI&gt;POST&amp;nbsp; &lt;A href="https://api.powerbi.com/v1.0/myorg/groups/%7bWORKSPACE_ID%7d/datasets/%7bDataSet_ID%7d/executeQueries" target="_blank"&gt;https://api.powerbi.com/v1.0/myorg/groups/{WORKSPACE_ID}/datasets/{DataSet_ID}/executeQueries&lt;/A&gt; - Got error.&amp;nbsp; &lt;STRONG&gt;401 Unauthorized &lt;/STRONG&gt;"PowerBINotAuthorizedException"&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I had enabled Service Principal Access in Power BI and granted all the necessary permissions:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Enabled "Service principals can use Fabric APIs," in admin portal&lt;/LI&gt;&lt;LI&gt;Added the Service Principal as Admin in the Power BI Workspace&lt;/LI&gt;&lt;LI&gt;Added all datasets and reports permissions under ‘delegated permissions’ because they do not exist under ‘application permissions’.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that the datasets and reports permission should be added with API permission type, but the application permissions only show ‘Tenant.Read.All’ and ‘Tenant.ReadWrite.All’ ?&amp;nbsp; Anything I miss?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2026 13:13:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Issue-with-Power-BI-API-Permissions-for-Datasets-401/m-p/5188400#M65139</guid>
      <dc:creator>Xiaolingwh</dc:creator>
      <dc:date>2026-05-25T13:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Power BI API Permissions for Datasets - 401 Unauthorized "PowerBINotAuthorizedEx</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Issue-with-Power-BI-API-Permissions-for-Datasets-401/m-p/5188629#M65142</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1598205"&gt;@Xiaolingwh&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Thank you for reaching out to Microsoft Community.&lt;/P&gt;
&lt;P&gt;Since the GET datasets API is working, the authentication setup appears to be correct. The 401 Unauthorized "PowerBINotAuthorizedException" during ExecuteQueries is usually related to dataset permissions or tenant settings.&lt;/P&gt;
&lt;P&gt;Please verify the following:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Ensure both tenant settings are enabled in Power BI Admin Portal:&lt;BR /&gt;Service principals can use Fabric APIs&lt;BR /&gt;Dataset Execute Queries REST API&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Explicitly grant the Service Principal:&lt;BR /&gt;Build permission, read permission on the dataset under Manage Permissions.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Verify the semantic model is not using unsupported scenarios such as RLS, SSO, or certain Live Connections.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Confirm the access token audience (aud) is: &lt;A href="https://analysis.windows.net/powerbi/api" target="_blank"&gt;https://analysis.windows.net/powerbi/api&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;If tenant settings are restricted to a security group, ensure the Service Principal is added to that group and allow time for propagation.&lt;/P&gt;
&lt;P&gt;Also, it is expected that Dataset/Report permissions are available only as Delegated permissions in Azure AD. Most Power BI REST APIs with Service Principals rely on workspace and tenant-level authorization rather than Application API permissions.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2026 06:10:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Issue-with-Power-BI-API-Permissions-for-Datasets-401/m-p/5188629#M65142</guid>
      <dc:creator>v-echaithra</dc:creator>
      <dc:date>2026-05-26T06:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Power BI API Permissions for Datasets - 401 Unauthorized "PowerBINotAuthorizedEx</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Issue-with-Power-BI-API-Permissions-for-Datasets-401/m-p/5190323#M65152</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1598205"&gt;@Xiaolingwh&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We’d like to follow up regarding the recent concern. Kindly confirm whether the issue has been resolved, or if further assistance is still required. We are available to support you and are committed to helping you reach a resolution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2026 05:51:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Issue-with-Power-BI-API-Permissions-for-Datasets-401/m-p/5190323#M65152</guid>
      <dc:creator>v-echaithra</dc:creator>
      <dc:date>2026-05-29T05:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Power BI API Permissions for Datasets - 401 Unauthorized "PowerBINotAuthorizedEx</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Issue-with-Power-BI-API-Permissions-for-Datasets-401/m-p/5191364#M65157</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1598205"&gt;@Xiaolingwh&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We wanted to kindly follow up regarding your query. If you need any further assistance, please reach out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2026 12:44:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Issue-with-Power-BI-API-Permissions-for-Datasets-401/m-p/5191364#M65157</guid>
      <dc:creator>v-echaithra</dc:creator>
      <dc:date>2026-06-01T12:44:50Z</dc:date>
    </item>
  </channel>
</rss>

