Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
On June 12th Microsoft annouced that they are combininng Azure Power BI embedding and PowerBI Services. Until June 12th we were using Azure services to embed and it was working fine with RLS feature. Now we moved everything to PowerBi Services and we are able to achieve embedding But we are not able to use RLS. In Azure, to create embed token we provide username and role which is used for RLS in pbix but in PowerBi Services, to create embed token it takes in Authentication Code, Group Id and Report ID alone and Embed token is generated by Mircosoft. So I would like to know if there is any way of using RLS method in the PowerBI services to filter the data. We would use URL filter method but it is not as secure as RLS method .
Thanks,
Raj
Solved! Go to Solution.
@vickyprudhvi wrote:
thank you for your reply.
yes I knoow that RLS works in PowerBi Services but we are using the reports for embedding into an app for NON PowerBI users. So wnat to know if there is a way for RLS to work for Non PowerBI Users too as URL level Filter is not secure
RLS works for the old embedding model(deprecated), for the new model, the RLS feature is on the roadmap and would be released in next quarter. So at this moment, using filter in the Power BI Javascript API can be the only workaround. See a demo below. If RLS is mandotory, you could still use the old embedding model, the old Power BI Embedded service(on azure) will continue to be available for a limited time.
<html> <script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"></script> <script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js"></script> <script type="text/javascript"> window.onload = function () {
var users= ["user1"]; //get the client name with javascript from your page var Filter = { $schema: "http://powerbi.com/product/schema#basic", target: { table: "Table", column: "username" }, operator: "Contains", values: users } // Read embed application token from Model var accessToken = "H4sIAAAAAAAEAB2 xxxxx uCwAA"; // Read embed URL from Model var embedUrl = "https://app.powerbi.com/reportEmbed?reportId=1f1d9145-738a-4d20-ab5b-1236b283e942&groupId=73e1a3c6-08c4-4651-aa04-2bb701a573c7"; // Read report Id from Model var embedReportId = "1f1d9145-738a-4d20-ab5b-1236b283e942"; // Get models. models contains enums that can be used. var models = window['powerbi-client'].models; // Embed configuration used to describe the what and how to embed. // This object is used when calling powerbi.embed. // This also includes settings and options such as filters. // You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details. var embedConfiguration = { type: 'report', tokenType: models.TokenType.Embed, accessToken: accessToken, embedUrl: embedUrl, id: embedReportId, permissions: models.Permissions.All, filters:[Filter,Filter2], settings: { filterPaneEnabled: true, navContentPaneEnabled: true } }; var $reportContainer = $('#reportContainer'); var report = powerbi.embed($reportContainer.get(0), embedConfiguration); } </script> <div id="reportContainer" powerbi-settings-nav-content-pane-enabled="true" powerbi-settings-filter-pane-enabled="true"></div> </html>
Hi @vickyprudhvi,
You might have seen the message that RLS has been moved to Power BI Desktop. So we can create RLS roles in Power BI Desktop and then publish it to the Service. Finally we add members to a role to make it work.
Best Regards!
Dale
thank you for your reply.
yes I knoow that RLS works in PowerBi Services but we are using the reports for embedding into an app for NON PowerBI users. So wnat to know if there is a way for RLS to work for Non PowerBI Users too as URL level Filter is not secure
@vickyprudhvi wrote:
thank you for your reply.
yes I knoow that RLS works in PowerBi Services but we are using the reports for embedding into an app for NON PowerBI users. So wnat to know if there is a way for RLS to work for Non PowerBI Users too as URL level Filter is not secure
RLS works for the old embedding model(deprecated), for the new model, the RLS feature is on the roadmap and would be released in next quarter. So at this moment, using filter in the Power BI Javascript API can be the only workaround. See a demo below. If RLS is mandotory, you could still use the old embedding model, the old Power BI Embedded service(on azure) will continue to be available for a limited time.
<html> <script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"></script> <script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js"></script> <script type="text/javascript"> window.onload = function () {
var users= ["user1"]; //get the client name with javascript from your page var Filter = { $schema: "http://powerbi.com/product/schema#basic", target: { table: "Table", column: "username" }, operator: "Contains", values: users } // Read embed application token from Model var accessToken = "H4sIAAAAAAAEAB2 xxxxx uCwAA"; // Read embed URL from Model var embedUrl = "https://app.powerbi.com/reportEmbed?reportId=1f1d9145-738a-4d20-ab5b-1236b283e942&groupId=73e1a3c6-08c4-4651-aa04-2bb701a573c7"; // Read report Id from Model var embedReportId = "1f1d9145-738a-4d20-ab5b-1236b283e942"; // Get models. models contains enums that can be used. var models = window['powerbi-client'].models; // Embed configuration used to describe the what and how to embed. // This object is used when calling powerbi.embed. // This also includes settings and options such as filters. // You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details. var embedConfiguration = { type: 'report', tokenType: models.TokenType.Embed, accessToken: accessToken, embedUrl: embedUrl, id: embedReportId, permissions: models.Permissions.All, filters:[Filter,Filter2], settings: { filterPaneEnabled: true, navContentPaneEnabled: true } }; var $reportContainer = $('#reportContainer'); var report = powerbi.embed($reportContainer.get(0), embedConfiguration); } </script> <div id="reportContainer" powerbi-settings-nav-content-pane-enabled="true" powerbi-settings-filter-pane-enabled="true"></div> </html>
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |