Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
adcolani
Regular Visitor

Row-Level Security in SQL Azure - Direct Query in Power BI

Is it possible to set the Session_Context from Power BI with Direct Query mode so that we can use the row-level security feature in SQL Azure?

 

 

3 REPLIES 3
v-qiuyu-msft
Community Support
Community Support

Hi @adcolani,

 

In Power BI, we can connect to Azure SQL database in Direct Query mode. See: Use DirectQuery in Power BI Desktop.

 

Then in Power BI desktop, we can set a role to filter data, after publish to service, we can apply this role to users. For more information, see: Row-level security (RLS) with Power BI.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thanks Qiuyun.

 

This seems we will be duplicating the row level security in both sql and power bi. Is there a way that the current user's username transparently flows from power bi to sql ( via Session_Context ) so the data is always secured no matter if we implement this at Power BI or not. Is this something in pipeline? 

 

Something like how it transparently works with AS https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-tutorial-row-level-security-onprem...

 

 

https://docs.microsoft.com/en-us/sql/relational-databases/security/row-level-security


This seems we will be duplicating the row level security in both sql and power bi. Is there a way that the current user's username transparently flows from power bi to sql ( via Session_Context ) so the data is always secured no matter if we implement this at Power BI or not. Is this something in pipeline? 


 

Hi @adcolani,

 

Whether we connect to SQL Server database in Import mode or DirectQuery, the Power BI RLS is filtered based on retrieved data. It means, when we enter credential for SQL data source, assume this user is limited to retrieve 10 rows, if you set RLS role on Power BI side, it will filter on those 10 rows. SQL Server can't work as in the same as SSAS.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors