<?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 Operation returned an invalid status code 'Forbidden while executing ExportToFileInGroupAsync in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-while/m-p/1194189#M24473</link>
    <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;By using the above document link, i tried to export a power bi report from an application using this code in .net core framework.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;&lt;/SPAN&gt;var powerBIReportExportConfiguration = new PowerBIReportExportConfiguration&lt;BR /&gt;{&lt;BR /&gt;Settings = new ExportReportSettings&lt;BR /&gt;{&lt;BR /&gt;Locale = "en-us",&lt;BR /&gt;},&lt;BR /&gt;Pages = pageNames?.Select(pn =&amp;gt; new ExportReportPage(pageName = pn)).ToList(),&lt;BR /&gt;};&lt;BR /&gt;var exportRequest = new ExportReportRequest&lt;BR /&gt;{&lt;BR /&gt;Format = format,&lt;BR /&gt;PowerBIReportConfiguration = powerBIReportExportConfiguration,&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var url = XXX;&lt;BR /&gt;var content = new Dictionary&amp;lt;string, string&amp;gt;();&lt;BR /&gt;content["grant_type"] = "XXX";&lt;BR /&gt;content["resource"] = "XXX";&lt;BR /&gt;content["username"] = XXX;&lt;BR /&gt;content["password"] = XXX;&lt;BR /&gt;content["client_id"] = XXX;&lt;/P&gt;&lt;P&gt;var response = await APIHelper.MakeAsyncRequest(url, content);&lt;BR /&gt;var tokenresult = response.Content.ReadAsStringAsync().Result;&lt;BR /&gt;var OAuthResultModel = JsonConvert.DeserializeObject&amp;lt;OAuthResultModel&amp;gt;(tokenresult);&lt;BR /&gt;var authenticationResult = OAuthResultModel;&lt;/P&gt;&lt;P&gt;var credentials = new TokenCredentials(authenticationResult.AccessToken, "Bearer");&lt;BR /&gt;var client = new PowerBIClient(credentials);&lt;BR /&gt;var reportsResult = await client.Reports.ExportToFileInGroupAsync(GroupID, ReportID, exportRequest);&lt;BR /&gt;&lt;BR /&gt;While executing the last line, code break and through an exception, i.e.:&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;{"Operation returned an invalid status code 'Forbidden"}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jul 2020 07:21:57 GMT</pubDate>
    <dc:creator>saadashraf</dc:creator>
    <dc:date>2020-07-01T07:21:57Z</dc:date>
    <item>
      <title>Operation returned an invalid status code 'Forbidden while executing ExportToFileInGroupAsync</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-while/m-p/1194189#M24473</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;By using the above document link, i tried to export a power bi report from an application using this code in .net core framework.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;&lt;/SPAN&gt;var powerBIReportExportConfiguration = new PowerBIReportExportConfiguration&lt;BR /&gt;{&lt;BR /&gt;Settings = new ExportReportSettings&lt;BR /&gt;{&lt;BR /&gt;Locale = "en-us",&lt;BR /&gt;},&lt;BR /&gt;Pages = pageNames?.Select(pn =&amp;gt; new ExportReportPage(pageName = pn)).ToList(),&lt;BR /&gt;};&lt;BR /&gt;var exportRequest = new ExportReportRequest&lt;BR /&gt;{&lt;BR /&gt;Format = format,&lt;BR /&gt;PowerBIReportConfiguration = powerBIReportExportConfiguration,&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var url = XXX;&lt;BR /&gt;var content = new Dictionary&amp;lt;string, string&amp;gt;();&lt;BR /&gt;content["grant_type"] = "XXX";&lt;BR /&gt;content["resource"] = "XXX";&lt;BR /&gt;content["username"] = XXX;&lt;BR /&gt;content["password"] = XXX;&lt;BR /&gt;content["client_id"] = XXX;&lt;/P&gt;&lt;P&gt;var response = await APIHelper.MakeAsyncRequest(url, content);&lt;BR /&gt;var tokenresult = response.Content.ReadAsStringAsync().Result;&lt;BR /&gt;var OAuthResultModel = JsonConvert.DeserializeObject&amp;lt;OAuthResultModel&amp;gt;(tokenresult);&lt;BR /&gt;var authenticationResult = OAuthResultModel;&lt;/P&gt;&lt;P&gt;var credentials = new TokenCredentials(authenticationResult.AccessToken, "Bearer");&lt;BR /&gt;var client = new PowerBIClient(credentials);&lt;BR /&gt;var reportsResult = await client.Reports.ExportToFileInGroupAsync(GroupID, ReportID, exportRequest);&lt;BR /&gt;&lt;BR /&gt;While executing the last line, code break and through an exception, i.e.:&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;{"Operation returned an invalid status code 'Forbidden"}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 07:21:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-while/m-p/1194189#M24473</guid>
      <dc:creator>saadashraf</dc:creator>
      <dc:date>2020-07-01T07:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Forbidden while executing ExportToFileInGroupAsync</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-while/m-p/1199225#M24554</link>
      <description>&lt;P&gt;Does it work in the sandbox?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exporttofileingroup" target="_blank"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exporttofileingroup&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(click the Try it button)&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 02:26:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-while/m-p/1199225#M24554</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-07-03T02:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Forbidden while executing ExportToFileInGroupAsync</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-while/m-p/1199407#M24555</link>
      <description>&lt;P&gt;yes. This kind of json returned with status code 200.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saadashraf_0-1593749719026.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/304694i9869272CBD9117E6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saadashraf_0-1593749719026.png" alt="saadashraf_0-1593749719026.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 04:16:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Operation-returned-an-invalid-status-code-Forbidden-while/m-p/1199407#M24555</guid>
      <dc:creator>saadashraf</dc:creator>
      <dc:date>2020-07-03T04:16:51Z</dc:date>
    </item>
  </channel>
</rss>

