<?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: Unable to get RLS security to work with an “app owns data” embedded PBI using Azure Analysis Ser in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Unable-to-get-RLS-security-to-work-with-an-app-owns-data/m-p/448469#M13797</link>
    <description>&lt;P&gt;Thank you for the response Dale. I did review that documentation before posting to this forum but have not been able to figure out what I am doing wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've seen conflicting messages in posts and in the MSFT documentation, can you confirm:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Are roles supported in Azure Analysis Services when using PBI embed tokens? (RLS &lt;EM&gt;not&lt;/EM&gt; defined in PBI)&lt;/P&gt;&lt;P&gt;2. Is CustomData supported in Azure Analysis Services&amp;nbsp;when using PBI embed tokens?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jun 2018 14:45:58 GMT</pubDate>
    <dc:creator>opensky</dc:creator>
    <dc:date>2018-06-26T14:45:58Z</dc:date>
    <item>
      <title>Unable to get RLS security to work with an “app owns data” embedded PBI using Azure Analysis Service</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unable-to-get-RLS-security-to-work-with-an-app-owns-data/m-p/446470#M13756</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for some help getting RLS to work with embedded Power BI and AAS. Here is the scenario:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Deploying as App-owns-data&lt;/LI&gt;&lt;LI&gt;RLS setup with roles in AAS (RLS not configured in PBI)&lt;/LI&gt;&lt;LI&gt;Power BI using a live connection to AAS&lt;/LI&gt;&lt;LI&gt;Using Javascript to embed a Power BI report into a webpage&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I verified that the roles are restricting data as expected by connecting to AAS using the Power BI client and Excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Able to successfully retrieve an access token from:&amp;nbsp;&lt;A href="https://login.microsoftonline.com/common/oauth2/token" target="_blank"&gt;https://login.microsoftonline.com/common/oauth2/token&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Able to generate an embed token by hitting: &lt;A target="_blank"&gt;https://api.powerbi.com/v1.0/myorg/groups/&amp;lt;groupId&amp;gt;/reports/&amp;lt;reportId&amp;gt;/GenerateToken&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the embed&amp;nbsp;token&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;I am able to successfully embed a report with no RLS applied.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when attempting to use identities to apply roles or customData to trigger RLS, the data doesn’t seem to pass through to AAS and the RLS is not applied.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm creating the embed token by hitting:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_blank"&gt;https://api.powerbi.com/v1.0/myorg/groups/&amp;lt;groupId&amp;gt;/reports/&amp;lt;reportId&amp;gt;/GenerateToken&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;formData = {&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; "accessLevel": "View",&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; "identities": [&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; {&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"username": userName,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"roles": [ role ],&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"customData":customData,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"datasets": [ datasetId ]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; ]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the generated token doesn’t cause RLS to be applied when the report is embedded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By adding the username and customData fields to a PBI report I can see that the username that AAS sees is the master account that is used for getting the access token, not the effective username passed in the identities payload. The customData value doesn’t show up in the report either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried the PowerBIEmbedded_AppOwnsData sample project from here:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/Microsoft/PowerBI-Developer-Samples/tree/master/App%20Owns%20Data/PowerBIEmbedded_AppOwnsData" target="_blank"&gt;https://github.com/Microsoft/PowerBI-Developer-Samples/tree/master/App%20Owns%20Data/PowerBIEmbedded_AppOwnsData&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This sample project successfully embeds the report but when I select the “View as a different user” and add a user and role I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{"error":{"code":"InvalidRequest","message":"Creating embed token for accessing dataset &amp;lt;id&amp;gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;requries&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;effective identity username to be identical to the caller's principal name"}}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For additional reference, the dataset has the these properties set:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;isRefreshable: false,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;isEffectiveIdentityRequired: true,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;isEffectiveIdentityRolesRequired: false,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;isOnPremGatewayRequired: false&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions on what I am doing wrong? Thanks for any help!&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jun 2018 00:08:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unable-to-get-RLS-security-to-work-with-an-app-owns-data/m-p/446470#M13756</guid>
      <dc:creator>opensky</dc:creator>
      <dc:date>2018-06-23T00:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get RLS security to work with an “app owns data” embedded PBI using Azure Analysis Ser</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unable-to-get-RLS-security-to-work-with-an-app-owns-data/m-p/448101#M13790</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/69445"&gt;@opensky&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please refer to&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded-row-level-security#working-with-analysis-services-live-connections" target="_self"&gt;embedded-row-level-security#working-with-analysis-services-live-connections&lt;/A&gt;. I think you can get the solutions there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: 'Segoe UI'; font-size: 10.5pt; color: #333333;"&gt;Best Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: 'Segoe UI'; font-size: 10.5pt; color: #333333;"&gt;Dale&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 07:04:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unable-to-get-RLS-security-to-work-with-an-app-owns-data/m-p/448101#M13790</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2018-06-26T07:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get RLS security to work with an “app owns data” embedded PBI using Azure Analysis Ser</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unable-to-get-RLS-security-to-work-with-an-app-owns-data/m-p/448469#M13797</link>
      <description>&lt;P&gt;Thank you for the response Dale. I did review that documentation before posting to this forum but have not been able to figure out what I am doing wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've seen conflicting messages in posts and in the MSFT documentation, can you confirm:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Are roles supported in Azure Analysis Services when using PBI embed tokens? (RLS &lt;EM&gt;not&lt;/EM&gt; defined in PBI)&lt;/P&gt;&lt;P&gt;2. Is CustomData supported in Azure Analysis Services&amp;nbsp;when using PBI embed tokens?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 14:45:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unable-to-get-RLS-security-to-work-with-an-app-owns-data/m-p/448469#M13797</guid>
      <dc:creator>opensky</dc:creator>
      <dc:date>2018-06-26T14:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get RLS security to work with an “app owns data” embedded PBI using Azure Analysis Ser</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unable-to-get-RLS-security-to-work-with-an-app-owns-data/m-p/458819#M14130</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/69445"&gt;@opensky&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The documentation is quite clear.&lt;/P&gt;
&lt;P&gt;1. Please refer to&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded-row-level-security#considerations-and-limitations" target="_self"&gt;developer/embedded-row-level-security#considerations-and-limitations&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;gt;&amp;gt;Azure Analysis Services live connections &lt;STRONG&gt;support filtering by roles&lt;/STRONG&gt;, but not dynamic by username. Dynamic filtering can be done using CustomData.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;2. Please refer to the blue Note in&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded-row-level-security#working-with-analysis-services-live-connections" target="_self"&gt;embedded-row-level-security#working-with-analysis-services-live-connections&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;gt;&amp;gt;The CustomData feature will &lt;STRONG&gt;only work for models that reside in Azure Analysis Services&lt;/STRONG&gt;, and it only works in live mode. Unlike users and roles, the custom data feature can't be set inside a .pbix file. When generating a token with the custom data feature you must a have user name.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Dale&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 13:25:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unable-to-get-RLS-security-to-work-with-an-app-owns-data/m-p/458819#M14130</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2018-07-10T13:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get RLS security to work with an “app owns data” embedded PBI using Azure Analysis Ser</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Unable-to-get-RLS-security-to-work-with-an-app-owns-data/m-p/479874#M14716</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/69445"&gt;@opensky&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a couple of settings that you need to get right .&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the below representation of embed token "username" should always be the Master /service account which is a power bi pro account . The dataset in Power BI should be configured using this &amp;nbsp;account .&amp;nbsp;&lt;/P&gt;&lt;P&gt;"roles" attribute should contain the rolename that you have configured in your Azure AS model .&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Customdata" attribute should contain the username for whom you want to process the report.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The DAX expression for the AS ROLE &amp;nbsp; should use CUSTOMDATA() function instead of USERNAME()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;formData = {&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; "accessLevel": "View",&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; "identities": [&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; {&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"username": master/Service account,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"roles": [ rolename ],&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"customData":user@domain.com,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"datasets": [ datasetId ]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; ]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 11:50:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Unable-to-get-RLS-security-to-work-with-an-app-owns-data/m-p/479874#M14716</guid>
      <dc:creator>abhijitger</dc:creator>
      <dc:date>2018-08-03T11:50:32Z</dc:date>
    </item>
  </channel>
</rss>

