<?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: Using Service Principal for REST API / Data Refresh in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Using-Service-Principal-for-REST-API-Data-Refresh/m-p/2239571#M33453</link>
    <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/325592"&gt;@akarkal&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;I'm glad to hear you found and share the workaround to resolve the issue.&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;I think they may help if others faced a similar scenario.&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Dec 2021 06:49:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-12-15T06:49:45Z</dc:date>
    <item>
      <title>Using Service Principal for REST API / Data Refresh</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-Service-Principal-for-REST-API-Data-Refresh/m-p/2228437#M33350</link>
      <description>&lt;P&gt;I have a C# App that uses a Active Directory User to perform the following operations, I am trying to convert it to use a Active Directory Service Principal. I am using&amp;nbsp;&lt;STRONG&gt;Power Embedded Workspace with Premium Capacity in Azure&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- Create DataSet&lt;/P&gt;&lt;P&gt;- Create Report&lt;/P&gt;&lt;P&gt;- Refresh DataSet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However I am running into issues when trying to get the same actions performed using a Service Principal.&lt;/P&gt;&lt;P&gt;I have the following things setup&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;01. Api access granted to Service Principal&lt;/P&gt;&lt;P&gt;&amp;nbsp;- restricted the access to a specific group and made sure that the Service Principal I am using is added to this security group&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-12-07 at 2.36.50 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/640647iA00C6F82A2ACE1A2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-12-07 at 2.36.50 PM.png" alt="Screen Shot 2021-12-07 at 2.36.50 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(Screenshot : courtesey youtube video from GuyInACube (&lt;A href="https://www.youtube.com/watch?v=1SO19uik1rw" target="_blank" rel="noopener"&gt;https://www.youtube.com/watch?v=1SO19uik1rw&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;02. added service principal on the workspace with the role "Admin"&lt;/P&gt;&lt;P&gt;03. I am using AppOwnsData project from&amp;nbsp;&lt;A href="https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/.NET%20Core/Embed%20for%20your%20customers/AppOwnsData" target="_blank" rel="noopener"&gt;https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/.NET%20Core/Embed%20for%20your%20customers/AppOwnsData&lt;/A&gt;&amp;nbsp;and getting error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;Operation returned an invalid status code 'Unauthorized'&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;at Microsoft.PowerBI.Api.ReportsOperations.GetReportInGroupWithHttpMessagesAsync(Guid groupId, Guid reportId, Dictionary`2 customHeaders, CancellationToken cancellationToken)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;at Microsoft.PowerBI.Api.ReportsOperationsExtensions.GetReportInGroupAsync(IReportsOperations operations, Guid groupId, Guid reportId, CancellationToken cancellationToken)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;at Microsoft.PowerBI.Api.ReportsOperationsExtensions.GetReportInGroup(IReportsOperations operations, Guid groupId, Guid reportId)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;at AppOwnsData.Services.PbiEmbedService.GetEmbedParams(Guid workspaceId, Guid reportId, Guid additionalDatasetId) in C:\Campuslabs\TeamFoundation\PowerBI-Developer-Samples\.NET Core\Embed for your customers\AppOwnsData\Services\PbiEmbedService.cs:line 46&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;at AppOwnsData.Controllers.EmbedInfoController.GetEmbedInfo() in C:\Campuslabs\TeamFoundation\PowerBI-Developer-Samples\.NET Core\Embed for your customers\AppOwnsData\Controllers\EmbedInfoController.cs:line 45&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is&lt;/P&gt;&lt;P&gt;1. How do I troubleshoot this issue&lt;/P&gt;&lt;P&gt;2. Are Service Principal Credentials allowed to refresh / create / data sets on Power Embedded Workspace with Premium Capacity&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 18:02:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-Service-Principal-for-REST-API-Data-Refresh/m-p/2228437#M33350</guid>
      <dc:creator>akarkal</dc:creator>
      <dc:date>2021-12-08T18:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using Service Principal for REST API / Data Refresh</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-Service-Principal-for-REST-API-Data-Refresh/m-p/2234497#M33404</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/325592"&gt;@akarkal&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Account to your description, it seems like you missed adding the security group that you configure with the service principal as the member of power bi embedded group workspace so that the rest API can't recognize the corresponding authentication. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Please take a look at the following link to know more about these operations:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal#step-2---create-an-azure-ad-security-group" target="_blank"&gt;Embed Power BI content in an embedded analytics application with service principal and an application secret - Power BI | Microsoft Docs&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Dec 2021 02:20:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-Service-Principal-for-REST-API-Data-Refresh/m-p/2234497#M33404</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-13T02:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using Service Principal for REST API / Data Refresh</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-Service-Principal-for-REST-API-Data-Refresh/m-p/2235778#M33423</link>
      <description>&lt;P&gt;I was able to get this to work after removing the restrictions on the security group from the &lt;STRONG&gt;tenant settings&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;these are my settings now&lt;/P&gt;&lt;P&gt;- tenant : api enabled for service principal, no restrictions on security group&lt;/P&gt;&lt;P&gt;- SP added to workspace as administrator (directly , not via a group)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Dec 2021 14:28:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-Service-Principal-for-REST-API-Data-Refresh/m-p/2235778#M33423</guid>
      <dc:creator>akarkal</dc:creator>
      <dc:date>2021-12-13T14:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using Service Principal for REST API / Data Refresh</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Using-Service-Principal-for-REST-API-Data-Refresh/m-p/2239571#M33453</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/325592"&gt;@akarkal&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;I'm glad to hear you found and share the workaround to resolve the issue.&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;I think they may help if others faced a similar scenario.&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 06:49:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Using-Service-Principal-for-REST-API-Data-Refresh/m-p/2239571#M33453</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-15T06:49:45Z</dc:date>
    </item>
  </channel>
</rss>

