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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
shanu_123
Frequent Visitor

Power BI Embedded Authentication through Azure AD

I have implemeted Power BI Embedded sample "App-Own-Data" available at Power BI-Microsoft Docs, At the time of authenticate only that users are allowed that are added in workspace created in Power BI service, I want that all member Azure AD should able to authenticate and able to see reports based on roles, how can i authencate through azure AD in Power BI Embedded Application? As well roles are here hardcoded can we make them dynamic in code? Below is code for HomeController.cs -

 generateTokenRequestParameters = new GenerateTokenRequest("View", null, identities: new List<EffectiveIdentity> { new EffectiveIdentity(username: "username", roles: new List<string> { username == "mohit.gupta@systematixindia.com" ? "Manager" : "Manager1" }, datasets: new List<string> { "bd725bc3-09b4-4c21-84b4-727d84a3f131" }) });

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @shanu_123,

 

If you are embedding for non-Power BI users (app owns data), which is typically an ISV scenario, then you should be able to follow this article to implement RLS. You will need to configure the embed token to account for the user and role.

 As well roles are here hardcoded can we make them dynamic in code? 

Based on my understanding, if you could store all the app user info with the corresponding user name, roles, and datasets in your database or somewhere else. Then you should be able to get the required info (by retrieving the database) to generate the TokenRequest for the current app user dynamically. Smiley Happy

 

Regards

View solution in original post

1 REPLY 1
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @shanu_123,

 

If you are embedding for non-Power BI users (app owns data), which is typically an ISV scenario, then you should be able to follow this article to implement RLS. You will need to configure the embed token to account for the user and role.

 As well roles are here hardcoded can we make them dynamic in code? 

Based on my understanding, if you could store all the app user info with the corresponding user name, roles, and datasets in your database or somewhere else. Then you should be able to get the required info (by retrieving the database) to generate the TokenRequest for the current app user dynamically. Smiley Happy

 

Regards

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.