<?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 API authentication issue with executeQueries API - 401 Unauthorized in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/API-authentication-issue-with-executeQueries-API-401/m-p/2851687#M39335</link>
    <description>&lt;P&gt;Getting 401 Unauthorized response on specific dataset. Do not appear to have issues querying other datasets. Able to refresh target dataset without issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;scope: Dataset.ReadWrite.All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error response:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{ "error": { "code": "PowerBINotAuthorizedException", "pbi.error": { "code": "PowerBINotAuthorizedException", "parameters": {}, "details": [], "exceptionCulprit": 1 } } }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Oct 2022 15:12:37 GMT</pubDate>
    <dc:creator>lgordon</dc:creator>
    <dc:date>2022-10-19T15:12:37Z</dc:date>
    <item>
      <title>API authentication issue with executeQueries API - 401 Unauthorized</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/API-authentication-issue-with-executeQueries-API-401/m-p/2851687#M39335</link>
      <description>&lt;P&gt;Getting 401 Unauthorized response on specific dataset. Do not appear to have issues querying other datasets. Able to refresh target dataset without issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;scope: Dataset.ReadWrite.All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error response:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{ "error": { "code": "PowerBINotAuthorizedException", "pbi.error": { "code": "PowerBINotAuthorizedException", "parameters": {}, "details": [], "exceptionCulprit": 1 } } }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 15:12:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/API-authentication-issue-with-executeQueries-API-401/m-p/2851687#M39335</guid>
      <dc:creator>lgordon</dc:creator>
      <dc:date>2022-10-19T15:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: API authentication issue with executeQueries API - 401 Unauthorized</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/API-authentication-issue-with-executeQueries-API-401/m-p/2852745#M39343</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/172843"&gt;@lgordon&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Before you take this new REST API for a test spin, note that the tenant-level setting&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;Allow XMLA endpoints and Analyze in Excel with on-premises datasets&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;must be enabled in the Power BI admin portal, as depicted in the screenshot below.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vjianbolimsft_0-1666246627599.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/807424i3B2AAD26B1B6306C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vjianbolimsft_0-1666246627599.png" alt="vjianbolimsft_0-1666246627599.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Equally important and also consistent with XMLA read access, you need the Build permission for the dataset you want to query by using this new REST API. Contributors and workspace admins have this permission, but you can also grant it directly, as in the following screenshot. For more information, see&amp;nbsp;&lt;/SPAN&gt;&lt;A title="" href="https://docs.microsoft.com/power-bi/connect-data/service-datasets-build-permissions" target="_blank"&gt;Build permission for shared datasets&lt;/A&gt;&lt;SPAN&gt;. Also note that the workspace must be a modern (v2) workspace. Classic (legacy) workspaces are not supported. So, if your datasets still reside in a classic workspace, make sure you upgrade the workspace to the new (v2) workspace experience.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Besides, please consider about some limitations:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Datasets that are hosted in Azure Analysis Services or that have a live connection to an on-premises Azure Analysis Services model aren't supported.&lt;/LI&gt;
&lt;LI&gt;The tenant setting&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Dataset Execute Queries REST API&lt;/STRONG&gt;, found under&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Integration settings&lt;/STRONG&gt;, must be enabled.&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Service Principals aren't supported for datasets with RLS per&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/admin/service-admin-rls#considerations-and-limitations" data-linktype="absolute-path" target="_blank"&gt;RLS limitations&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;or with SSO enabled. To use Service Principals, make sure the admin tenant setting&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/admin/service-admin-portal-developer#allow-service-principals-to-use-power-bi-apis" data-linktype="absolute-path" target="_blank"&gt;&lt;EM&gt;Allow service principals to user Power BI APIs&lt;/EM&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;under&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;Developer settings&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;is enabled.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;For more details, please refer to:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries#permissions" target="_blank"&gt;Datasets - Execute Queries - REST API (Power BI Power BI REST APIs) | Microsoft Learn&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://powerbi.microsoft.com/en-us/blog/announcing-the-public-preview-of-power-bi-rest-api-support-for-dax-queries/" target="_blank"&gt;Announcing the public preview of Power BI REST API support for DAX Queries | Microsoft Power BI Blog | Microsoft Power BI&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jianbo Li&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 06:21:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/API-authentication-issue-with-executeQueries-API-401/m-p/2852745#M39343</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2022-10-20T06:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: API authentication issue with executeQueries API - 401 Unauthorized</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/API-authentication-issue-with-executeQueries-API-401/m-p/2853685#M39355</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I mentioned, I am able to query other datasets with this api, just not this specific dataset. This dataset is a composite dataset that does have a DQ over AS partition which is querying another dataset in PBI service -- which as I understand is not the same as Azure Analysis Services. I don't see any written limitation indicating this.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 12:50:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/API-authentication-issue-with-executeQueries-API-401/m-p/2853685#M39355</guid>
      <dc:creator>lgordon</dc:creator>
      <dc:date>2022-10-20T12:50:58Z</dc:date>
    </item>
  </channel>
</rss>

