Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Power BI Embedded connecting to Azure SQL Database with Authenticated user

Our requirement is to create a workspace with the API and that the Datasets pointing to the Azure SQL Databases with the credential of the current authenticated user in Azure Active Directory.


This would allow the connection to the Azure SQL Database using the current user for purposes of row level security. Otherwise using a service account would not provide the Row Level Security and it would expose data to the user that they would not be authorized to see. We will have both Single Tenant and Multi-Tenant databases. In both cases it would require row level security, so we need to be able to have the data source recognize the current logged in user.


Using the Power BI Embedded API's can the Database Connection String be configued for the Azure SQL Database to use the context of the current authenticated user in Azure Active Directory. If so are there codes samples for this.

Helper I
Helper I

Direct query mode does not support row level security authentication.


I have not tried configuring access through AD account yet, but it is probably a way to create multiple role based SQL accounts and map for the access.

We intend to do row level securiity via sql views which will test the current user. The issue is that in the dataset credentials in the power bi file we do not see an option to indicate currrent user if logged in via azure active directory. the azure sql dataabase is confiigured for azure active directory authentication. so when the user runs a report in powerbi we want it to connect to he azure database with the context of the current user and then the sql views will detect the current user and return the appropriate rows. the only other option would be for us to create a sql login for every user and then configure the user workspace with that credential. this could mean having to create thousands of additional logins plus maiintenance of those logins which would be not desirable as all this information currently exist in Azure Active Directory.

Helpful resources

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

Power BI Dev Camp Session 22 with aka link 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!