<?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 'Unauthorized' while connecting Power BI embed app. in Service</title>
    <link>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/2918799#M180304</link>
    <description>&lt;P&gt;I am getting error in the below line while connecting Power BI with embed app.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have give all id's in JSON settings like below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"AzureAd": {&lt;BR /&gt;"AuthenticationMode": "ServicePrincipal",&lt;BR /&gt;//"AuthorityUrl": "&lt;A href="https://login.microsoftonline.com/organizations/" target="_blank"&gt;https://login.microsoftonline.com/organizations/&lt;/A&gt;",&lt;BR /&gt;"AuthorityUrl": "&lt;A href="https://login.microsoftonline.com/que8ad7-adsd-w22sf-23iuhsasd" target="_blank"&gt;https://login.microsoftonline.com/que8ad7-adsd-w22sf-23iuhsasd&lt;/A&gt;",&lt;BR /&gt;"ClientId": "fdsguy-erhdj-rtyuiw-32987ud-fdwiu8ds7s",&lt;BR /&gt;"TenantId": "8fdf987ad87-dsafi-ytrt5-niuwoiuafm09er9",&lt;BR /&gt;"ScopeBase": [ "&lt;A href="https://analysis.windows.net/powerbi/api/.default" target="_blank"&gt;https://analysis.windows.net/powerbi/api/.default&lt;/A&gt;" ],&lt;BR /&gt;"PbiUsername": "comp1@tek.com",&lt;BR /&gt;"PbiPassword": "************",&lt;BR /&gt;"ClientSecret": "fdsgshfgajdad-dafdbvnvfoiepi-3edfsfdshj"&lt;BR /&gt;},&lt;BR /&gt;"PowerBI": {&lt;BR /&gt;"WorkspaceId": "4398dsewwsdfkg-fdijo-hoigu-kjfdj-irkfjfjdsa0w987e", &lt;BR /&gt;"ReportId": "fvxcn-cvkbvj-vcxbivc-vcxbj-er9rekjxlj",&lt;BR /&gt;"DataSetId": "hfakjfdadaf-adsfljjreuu8-fdld87fsf-fsghfkfs"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, still i am getting&amp;nbsp; below error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Error Details:&lt;BR /&gt;&lt;STRONG&gt;Operation returned an invalid status code 'Unauthorized'&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;at Microsoft.PowerBI.Api.ReportsOperations.GetReportInGroupWithHttpMessagesAsync(Guid groupId, Guid reportId, Dictionary`2 customHeaders, CancellationToken cancellationToken)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;at Microsoft.PowerBI.Api.ReportsOperationsExtensions.GetReportInGroupAsync(IReportsOperations operations, Guid groupId, Guid reportId, CancellationToken cancellationToken)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;at Microsoft.PowerBI.Api.ReportsOperationsExtensions.GetReportInGroup(IReportsOperations operations, Guid groupId, Guid reportId)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;at AppOwnsData.Services.PbiEmbedService.GetEmbedParams(Guid workspaceId, Guid reportId, Guid additionalDatasetId) in C:\Users\PowerBI-Developer-Samples-master\.NET Core\Embed for your customers\AppOwnsData\Services\PbiEmbedService.cs:line 46&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;at AppOwnsData.Controllers.EmbedInfoController.GetEmbedInfo() in C:\Users\PowerBI-Developer-Samples-master\.NET Core\Embed for your customers\AppOwnsData\Controllers\EmbedInfoController.cs:line 45&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;below is my code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;public PowerBIClient GetPowerBIClient()&lt;BR /&gt;{&lt;BR /&gt;var tokenCredentials = new TokenCredentials(aadService.GetAccessToken(), "Bearer");&lt;BR /&gt;return new PowerBIClient(new Uri(powerBiApiUrl ), tokenCredentials);&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Error line&lt;/P&gt;
&lt;P&gt;*******************&lt;/P&gt;
&lt;P&gt;PowerBIClient pbiClient = this.GetPowerBIClient();&lt;/P&gt;
&lt;P&gt;// Get report info&lt;BR /&gt;var pbiReport = pbiClient.Reports.GetReportInGroup(workspaceId, reportId); ==&amp;gt; &lt;STRONG&gt;Error Line&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the error and how we could solve this....?&lt;/P&gt;</description>
    <pubDate>Mon, 21 Nov 2022 13:10:30 GMT</pubDate>
    <dc:creator>saivina2920</dc:creator>
    <dc:date>2022-11-21T13:10:30Z</dc:date>
    <item>
      <title>Operation returned an invalid status code 'Unauthorized' while connecting Power BI embed app.</title>
      <link>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/2918799#M180304</link>
      <description>&lt;P&gt;I am getting error in the below line while connecting Power BI with embed app.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have give all id's in JSON settings like below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"AzureAd": {&lt;BR /&gt;"AuthenticationMode": "ServicePrincipal",&lt;BR /&gt;//"AuthorityUrl": "&lt;A href="https://login.microsoftonline.com/organizations/" target="_blank"&gt;https://login.microsoftonline.com/organizations/&lt;/A&gt;",&lt;BR /&gt;"AuthorityUrl": "&lt;A href="https://login.microsoftonline.com/que8ad7-adsd-w22sf-23iuhsasd" target="_blank"&gt;https://login.microsoftonline.com/que8ad7-adsd-w22sf-23iuhsasd&lt;/A&gt;",&lt;BR /&gt;"ClientId": "fdsguy-erhdj-rtyuiw-32987ud-fdwiu8ds7s",&lt;BR /&gt;"TenantId": "8fdf987ad87-dsafi-ytrt5-niuwoiuafm09er9",&lt;BR /&gt;"ScopeBase": [ "&lt;A href="https://analysis.windows.net/powerbi/api/.default" target="_blank"&gt;https://analysis.windows.net/powerbi/api/.default&lt;/A&gt;" ],&lt;BR /&gt;"PbiUsername": "comp1@tek.com",&lt;BR /&gt;"PbiPassword": "************",&lt;BR /&gt;"ClientSecret": "fdsgshfgajdad-dafdbvnvfoiepi-3edfsfdshj"&lt;BR /&gt;},&lt;BR /&gt;"PowerBI": {&lt;BR /&gt;"WorkspaceId": "4398dsewwsdfkg-fdijo-hoigu-kjfdj-irkfjfjdsa0w987e", &lt;BR /&gt;"ReportId": "fvxcn-cvkbvj-vcxbivc-vcxbj-er9rekjxlj",&lt;BR /&gt;"DataSetId": "hfakjfdadaf-adsfljjreuu8-fdld87fsf-fsghfkfs"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, still i am getting&amp;nbsp; below error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Error Details:&lt;BR /&gt;&lt;STRONG&gt;Operation returned an invalid status code 'Unauthorized'&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;at Microsoft.PowerBI.Api.ReportsOperations.GetReportInGroupWithHttpMessagesAsync(Guid groupId, Guid reportId, Dictionary`2 customHeaders, CancellationToken cancellationToken)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;at Microsoft.PowerBI.Api.ReportsOperationsExtensions.GetReportInGroupAsync(IReportsOperations operations, Guid groupId, Guid reportId, CancellationToken cancellationToken)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;at Microsoft.PowerBI.Api.ReportsOperationsExtensions.GetReportInGroup(IReportsOperations operations, Guid groupId, Guid reportId)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;at AppOwnsData.Services.PbiEmbedService.GetEmbedParams(Guid workspaceId, Guid reportId, Guid additionalDatasetId) in C:\Users\PowerBI-Developer-Samples-master\.NET Core\Embed for your customers\AppOwnsData\Services\PbiEmbedService.cs:line 46&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;at AppOwnsData.Controllers.EmbedInfoController.GetEmbedInfo() in C:\Users\PowerBI-Developer-Samples-master\.NET Core\Embed for your customers\AppOwnsData\Controllers\EmbedInfoController.cs:line 45&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;below is my code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;public PowerBIClient GetPowerBIClient()&lt;BR /&gt;{&lt;BR /&gt;var tokenCredentials = new TokenCredentials(aadService.GetAccessToken(), "Bearer");&lt;BR /&gt;return new PowerBIClient(new Uri(powerBiApiUrl ), tokenCredentials);&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Error line&lt;/P&gt;
&lt;P&gt;*******************&lt;/P&gt;
&lt;P&gt;PowerBIClient pbiClient = this.GetPowerBIClient();&lt;/P&gt;
&lt;P&gt;// Get report info&lt;BR /&gt;var pbiReport = pbiClient.Reports.GetReportInGroup(workspaceId, reportId); ==&amp;gt; &lt;STRONG&gt;Error Line&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the error and how we could solve this....?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 13:10:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/2918799#M180304</guid>
      <dc:creator>saivina2920</dc:creator>
      <dc:date>2022-11-21T13:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Unauthorized' while connecting Power BI embed app.</title>
      <link>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/2920410#M180408</link>
      <description>&lt;P&gt;Anyone can update relate this issue pls..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is very very urgent.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 05:00:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/2920410#M180408</guid>
      <dc:creator>saivina2920</dc:creator>
      <dc:date>2022-11-22T05:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Unauthorized' while connecting Power BI embed app.</title>
      <link>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/2921297#M180461</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="114597" data-lia-user-login="saivina2920" class="lia-mention lia-mention-user"&gt;saivina2920&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could it be permission issue?&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The account must be the admin of the related workspaces when you need to embeded report in the application.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jay&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 09:53:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/2921297#M180461</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-22T09:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Unauthorized' while connecting Power BI embed app.</title>
      <link>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/2921374#M180467</link>
      <description>&lt;P&gt;Yes. It's great.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 10:23:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/2921374#M180467</guid>
      <dc:creator>saivina2920</dc:creator>
      <dc:date>2022-11-22T10:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Unauthorized' while connecting Power BI embed app.</title>
      <link>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/3424124#M205712</link>
      <description>&lt;P&gt;Hi you got any solution. I am stuck in same issue!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 10:51:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/3424124#M205712</guid>
      <dc:creator>MRIZ</dc:creator>
      <dc:date>2023-09-11T10:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Unauthorized' while connecting Power BI embed app.</title>
      <link>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/3603096#M215469</link>
      <description>&lt;P&gt;same issue too, do you have any solution&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 08:04:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/3603096#M215469</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-12-27T08:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Unauthorized' while connecting Power BI embed app.</title>
      <link>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/3603124#M215475</link>
      <description>&lt;P&gt;Hi, yes this issue was resolved for me. I did different things i am forgetting it, I guess I was forgetting to give admin access to my Service Pricncipal on my WorkSpace is Worspace Access option.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 08:18:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/3603124#M215475</guid>
      <dc:creator>MRIZ</dc:creator>
      <dc:date>2023-12-27T08:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Unauthorized' while connecting Power BI embed app.</title>
      <link>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/3603129#M215477</link>
      <description>&lt;P&gt;thanks. But i have done this&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 08:20:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/3603129#M215477</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-12-27T08:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Unauthorized' while connecting Power BI embed app.</title>
      <link>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/3603167#M215481</link>
      <description>&lt;P&gt;&lt;A href="https://dakarsoftwaretmp-my.sharepoint.com/:u:/g/personal/mrizwan_dakarsoftware_com/EcmSQ0RaWm9DuB3Fbhk29iABch4UBzpmIny9a4vJogDuGA?e=KD4eIX" target="_blank"&gt;OneDriveAppOwnsData.sln&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;this is running project for your reference. May be it can help you!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 08:36:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/3603167#M215481</guid>
      <dc:creator>MRIZ</dc:creator>
      <dc:date>2023-12-27T08:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Unauthorized' while connecting Power BI embed app.</title>
      <link>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/3603175#M215482</link>
      <description>&lt;P&gt;thanks, this is only the sln file, maybe you miss some others. And I want to know if you use the service principle to add or update data to powerBI, I can access to getworkspace, but fialed when try to upload new report, meet the 'unauthorized', I think maybe it is read-only?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 08:41:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/3603175#M215482</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-12-27T08:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Operation returned an invalid status code 'Unauthorized' while connecting Power BI embed app.</title>
      <link>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/3603186#M215483</link>
      <description>&lt;P&gt;Sorry for inconvinience, PFB updated link&lt;BR /&gt;Check if this runs for you or not after replacing all the values in json&lt;BR /&gt;&lt;A href="https://dakarsoftwaretmp-my.sharepoint.com/:u:/g/personal/mrizwan_dakarsoftware_com/EdF6Ol6CksVHjkgpQCEcn6sBJ2X2HfqR2iQTLI3henWmPQ?e=v8zY6c" target="_blank"&gt;Embed for your customers.rar&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 08:49:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/Operation-returned-an-invalid-status-code-Unauthorized-while/m-p/3603186#M215483</guid>
      <dc:creator>MRIZ</dc:creator>
      <dc:date>2023-12-27T08:49:20Z</dc:date>
    </item>
  </channel>
</rss>

