<?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: Getting error when calling Power BI Embed Report Export To PDF API in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Getting-error-when-calling-Power-BI-Embed-Report-Export-To-PDF/m-p/3424280#M44381</link>
    <description>&lt;P&gt;This looks like the exception when the error is returned, what I meant is the Http response message itself, it has headers and body. Maybe you can capture using Fiddler or other tool. Without the response message I can't help much&lt;/P&gt;</description>
    <pubDate>Mon, 11 Sep 2023 12:37:12 GMT</pubDate>
    <dc:creator>AmosHersch</dc:creator>
    <dc:date>2023-09-11T12:37:12Z</dc:date>
    <item>
      <title>Getting error when calling Power BI Embed Report Export To PDF API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Getting-error-when-calling-Power-BI-Embed-Report-Export-To-PDF/m-p/3421061#M44342</link>
      <description>&lt;P&gt;We are using Power BI c# SDK to export Power BI report in PDF.&lt;BR /&gt;We setup app registration in Azure Active Directory and assigned the required permissions. We Have power-bi-embedded A4 Plan&lt;BR /&gt;Some time pdf is generated and some time its not.&lt;BR /&gt;When its not generated, following error is thrown:&lt;BR /&gt;"Operation returned an invalid status code 'Forbidden'".&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;var tenantSpecificURL = this.PowerBIConfig.AuthorityUrl.Replace("common", this.PowerBIConfig.TenantId, StringComparison.InvariantCultureIgnoreCase);&lt;BR /&gt;var authenticationContext = new AuthenticationContext(tenantSpecificURL);&lt;BR /&gt;var credential = new Microsoft.IdentityModel.Clients.ActiveDirectory.ClientCredential(this.PowerBIConfig.ApplicationId, this.PowerBIConfig.ApplicationSecret);&lt;BR /&gt;var authenticationResult = await authenticationContext.AcquireTokenAsync(this.PowerBIConfig.ResourceUrl, credential).ConfigureAwait(false);&lt;BR /&gt;&lt;BR /&gt;var tokenCredentials = new TokenCredentials(authenticationResult.AccessToken, "Bearer");&lt;BR /&gt;PowerBIClient pbiClient = new PowerBIClient(new Uri(this.PowerBIConfig.ApiUrl), tokenCredentials);&lt;BR /&gt;Export export = pbiClient.Reports.ExportToFileInGroup(new Guid(this.PowerBIConfig.WorkspaceId), new Guid(reportID), exportRequest);&lt;BR /&gt;string exportId = export.Id;&lt;BR /&gt;do&lt;BR /&gt;{&lt;BR /&gt;export = pbiClient.Reports.GetExportToFileStatusInGroup(new Guid(this.PowerBIConfig.WorkspaceId), new Guid(reportID), exportId);&lt;BR /&gt;Console.WriteLine(" - Export status: " + export.PercentComplete.ToString() + "% complete");&lt;BR /&gt;}&lt;BR /&gt;while (export.Status != ExportState.Succeeded &amp;amp;&amp;amp; export.Status != ExportState.Failed);&lt;BR /&gt;&lt;BR /&gt;if (export.Status == ExportState.Failed)&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Export failed!");&lt;BR /&gt;}&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/966173iD989FC22E826BA97/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 07:48:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Getting-error-when-calling-Power-BI-Embed-Report-Export-To-PDF/m-p/3421061#M44342</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-08T07:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error when calling Power BI Embed Report Export To PDF API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Getting-error-when-calling-Power-BI-Embed-Report-Export-To-PDF/m-p/3422453#M44357</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Do you mean that the call to the "Export to File" API returns Forbidden?&lt;/P&gt;&lt;P&gt;Did you check to see if the response body has additional information for the reason of the Forbidden status?&lt;/P&gt;&lt;P&gt;If the response body is empty or doesn't help with understanding the issue you can reply here with the request ID from the response headers and I might be able to find the reason.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Sep 2023 10:38:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Getting-error-when-calling-Power-BI-Embed-Report-Export-To-PDF/m-p/3422453#M44357</guid>
      <dc:creator>AmosHersch</dc:creator>
      <dc:date>2023-09-09T10:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error when calling Power BI Embed Report Export To PDF API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Getting-error-when-calling-Power-BI-Embed-Report-Export-To-PDF/m-p/3424265#M44378</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;Operation returned an invalid status code 'Forbidden'||&amp;nbsp;&amp;nbsp; at *** at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()\r\n&amp;nbsp;&amp;nbsp; at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n&amp;nbsp;&amp;nbsp; at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.&amp;lt;InvokeActionMethodAsync&amp;gt;g__Logged|12_1(ControllerActionInvoker invoker)\r\n&amp;nbsp;&amp;nbsp; at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.&amp;lt;InvokeNextActionFilterAsync&amp;gt;g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n&amp;nbsp;&amp;nbsp; at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n&amp;nbsp;&amp;nbsp; at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State&amp;amp; next, Scope&amp;amp; scope, Object&amp;amp; state, Boolean&amp;amp; isCompleted)\r\n&amp;nbsp;&amp;nbsp; at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n&amp;nbsp;&amp;nbsp; at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.&amp;lt;InvokeNextResourceFilter&amp;gt;g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n&amp;nbsp;&amp;nbsp; at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\r\n&amp;nbsp;&amp;nbsp; at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State&amp;amp; next, Scope&amp;amp; scope, Object&amp;amp; state, Boolean&amp;amp; isCompleted)\r\n&amp;nbsp;&amp;nbsp; at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n&amp;nbsp;&amp;nbsp; at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.&amp;lt;InvokeAsync&amp;gt;g__Logged|17_1(ResourceInvoker invoker)\r\n&amp;nbsp;&amp;nbsp; at Microsoft.AspNetCore.Routing.EndpointMiddleware.&amp;lt;Invoke&amp;gt;g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)\r\n&amp;nbsp;&amp;nbsp; at *** in ***&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 12:27:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Getting-error-when-calling-Power-BI-Embed-Report-Export-To-PDF/m-p/3424265#M44378</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-11T12:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error when calling Power BI Embed Report Export To PDF API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Getting-error-when-calling-Power-BI-Embed-Report-Export-To-PDF/m-p/3424266#M44379</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/278935"&gt;@AmosHersch&lt;/a&gt;&amp;nbsp; responce error massage&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 12:28:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Getting-error-when-calling-Power-BI-Embed-Report-Export-To-PDF/m-p/3424266#M44379</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-11T12:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error when calling Power BI Embed Report Export To PDF API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Getting-error-when-calling-Power-BI-Embed-Report-Export-To-PDF/m-p/3424280#M44381</link>
      <description>&lt;P&gt;This looks like the exception when the error is returned, what I meant is the Http response message itself, it has headers and body. Maybe you can capture using Fiddler or other tool. Without the response message I can't help much&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 12:37:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Getting-error-when-calling-Power-BI-Embed-Report-Export-To-PDF/m-p/3424280#M44381</guid>
      <dc:creator>AmosHersch</dc:creator>
      <dc:date>2023-09-11T12:37:12Z</dc:date>
    </item>
  </channel>
</rss>

