<?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: Error 403 when trying to read data form a data set in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Error-403-when-trying-to-read-data-form-a-data-set/m-p/3253142#M42828</link>
    <description>&lt;P&gt;Hi vi-yiruan, thank you so much for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried everything but without success, but in the end the issue was in the configuration of the Azure AD app, and not having a security group created in Azure AD. Once we created one, we were able to connect to Power BI API using the access token that I showed in my initial post.&lt;BR /&gt;&lt;BR /&gt;Thanks again for the help, have a nice day.&lt;/P&gt;&lt;P&gt;ElfoEspacial&lt;/P&gt;</description>
    <pubDate>Thu, 25 May 2023 11:23:58 GMT</pubDate>
    <dc:creator>ElfoEspacial</dc:creator>
    <dc:date>2023-05-25T11:23:58Z</dc:date>
    <item>
      <title>Error 403 when trying to read data form a data set</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Error-403-when-trying-to-read-data-form-a-data-set/m-p/3242484#M42733</link>
      <description>&lt;P&gt;Hello everyone,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I'm working on a server-side integration for a client, which needs to connect to the Power BI API and read information from a Data Set. According to the Power BI documentation, this requires the permissions: Report.ReadWrite.All or Report.Read.All.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If I go to Azure and search for the app, these permissions are granted. What catches my attention is that when I generate an access token and try to access the report, it returns a 403 Forbidden error.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if the issue lies in the call that generates the access token, perhaps it's not being made with sufficient permissions.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Currently, I generate the access token with a POST request targeting the URL: &lt;A href="https://login.microsoftonline.com/%7Btenant_id%7D/oauth2/v2.0/token" target="_new"&gt;https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token&lt;/A&gt;, withand the following body:&lt;/P&gt;&lt;P&gt;grant_type: client_credentials,&lt;BR /&gt;client_id,&lt;BR /&gt;client_secret,&lt;BR /&gt;scope: &lt;A href="https://analysis.windows.net/powerbi/api/.default" target="_new"&gt;https://analysis.windows.net/powerbi/api/.default&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If I try to change the scope to "readAll," it tells me that the scope is invalid and must be "/.default."&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;On the other hand, I understand that the access token generated by this call should be able to access the reports if the app in Azure AD has the necessary permissions. However, when I try to access the report, I receive a 403 error.&lt;BR /&gt;&lt;BR /&gt;Lastly, when trying to acces the data in the report, this is the url I'm targeting:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://api.powerbi.com/v1.0/myorg/datasets/" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/datasets/{dataSetID}&lt;/A&gt;/tables/{tableName}/rows&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I would greatly appreciate any insights or help in identifying where the problem might be.&lt;BR /&gt;&lt;BR /&gt;Kind regards,&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 14:12:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Error-403-when-trying-to-read-data-form-a-data-set/m-p/3242484#M42733</guid>
      <dc:creator>ElfoEspacial</dc:creator>
      <dc:date>2023-05-18T14:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error 403 when trying to read data form a data set</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Error-403-when-trying-to-read-data-form-a-data-set/m-p/3246522#M42769</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/556086"&gt;@ElfoEspacial&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to the error code, it seems that it is caused by insufficient&amp;nbsp;permissions&amp;nbsp;or authentication. You can refer the following links to solve the problem.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/troubleshoot-rest-api#api-call-returns-403" target="_self"&gt;&lt;SPAN&gt;API call returns 403&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;A 403 error can occur for any of the following reasons. A Fiddler capture might be required to investigate further.&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;The user has exceeded the amount of embed token that can be generated on a shared capacity. Purchase Azure capacities to generate embed tokens and assign the workspace to that capacity. See&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/power-bi-embedded/create-capacity" data-linktype="absolute-path" target="_blank"&gt;Create Power BI Embedded capacity in the Azure portal&lt;/A&gt;.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;The Azure AD authorization token expired.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;The authenticated user isn't a member of the group (workspace).&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;The authenticated user isn't an admin of the group (workspace).&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;The authenticated user doesn't have permissions. Permissions can be updated using the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/users/refreshuserpermissions" data-linktype="absolute-path" target="_blank"&gt;refreshUserPermissions API&lt;/A&gt;.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;The authorization header might not be listed correctly. Make sure there are no typos.&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;FONT size="3"&gt;The backend of the application might need to refresh the authorization token before calling&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;GenerateToken&lt;/CODE&gt;. For more information, see&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/refresh-token" data-linktype="absolute-path" target="_blank"&gt;Refresh the access token&lt;/A&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/troubleshoot-rest-api#api-call-returns-403" target="_self"&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="https://community.powerbi.com/t5/Developer/Power-BI-REST-API-gives-403-error-User-does-not-have-access-to/m-p/607049" target="_blank"&gt;Solved: Power BI REST API gives 403 error (User does not h... - Microsoft Power BI Community&lt;/A&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;It seems I found the hidden setting:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&lt;A href="https://community.powerbi.com/t5/Service/Manage-Permissions-in-Power-BI-Service/td-p/322832" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Service/Manage-Permissions-in-Power-BI-Service/td-p/322832&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Apparently, the dataset in the workspace requires the user to be added with "Manage permissions"...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;After I did that, the error disappeared.&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 05:56:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Error-403-when-trying-to-read-data-form-a-data-set/m-p/3246522#M42769</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-22T05:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Error 403 when trying to read data form a data set</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Error-403-when-trying-to-read-data-form-a-data-set/m-p/3253142#M42828</link>
      <description>&lt;P&gt;Hi vi-yiruan, thank you so much for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried everything but without success, but in the end the issue was in the configuration of the Azure AD app, and not having a security group created in Azure AD. Once we created one, we were able to connect to Power BI API using the access token that I showed in my initial post.&lt;BR /&gt;&lt;BR /&gt;Thanks again for the help, have a nice day.&lt;/P&gt;&lt;P&gt;ElfoEspacial&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 11:23:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Error-403-when-trying-to-read-data-form-a-data-set/m-p/3253142#M42828</guid>
      <dc:creator>ElfoEspacial</dc:creator>
      <dc:date>2023-05-25T11:23:58Z</dc:date>
    </item>
  </channel>
</rss>

