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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
mittalpatel130
Helper III
Helper III

Power BI Embedded (JavaScript) App Owns Data - RLS is not working

Hello,

 

I've implemented Power BI Embedded solution (Apps own data) with Row level security using JavaScript. Embedded it successfully, however the Dynamic Row Level Security is not working in embedded page. It works fine in Power BI Service, Test as Role screen.

 

My scenario - 

1. Data Source - SQL Server On-premise (On-premise Gateway set-up)

2. Dynamic RLS is configued in Power BI Desktop 

3. Published Reports to Premium Capacity, upgraded Workspace

4. Embedded Solution - Apps Own Data using JavaScript (used GenerateToken method)

5. Added EffectiveIdentity as below in the JavaScript GenerateToken Call. 

{
    "accessLevel": "View",
    "identities": [
        {
            "username": "EffectiveIdentity",
            "roles": [ "Role1", "Role2" ],
            "customData": "MyCustomData",
            "datasets": [ "fe0a1aeb-f6a4-4b27-a2d3-b5df3bb28bdc" ]
        }
    ]
}

 

What is that I'm missing in this set up? 

 

Thank you!

 

 

1 ACCEPTED SOLUTION
nandukrishnavs
Community Champion
Community Champion

@mittalpatel130 

 

Refer to this documentation

https://docs.microsoft.com/en-us/power-bi/developer/embedded/embedded-row-level-security#applying-us...

 

 

{
    "accessLevel": "View",
    "identities": [
        {
            "username": "EffectiveIdentity",
            "roles": [ "Role1"],
            "datasets": [ "fe0a1aeb-f6a4-4b27-a2d3-b5df3bb28bdc" ]
        }
    ]
}

 

You have to replace "EffectiveIdentity" with currently logged in user's email id. And "Role1" should be replaced with the actual role name which is defined in the Power BI desktop. Dataset id (fe0a1aeb-f6a4-4b27-a2d3-b5df3bb28bdc) should replace with your report's dataset id.

 



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

View solution in original post

1 REPLY 1
nandukrishnavs
Community Champion
Community Champion

@mittalpatel130 

 

Refer to this documentation

https://docs.microsoft.com/en-us/power-bi/developer/embedded/embedded-row-level-security#applying-us...

 

 

{
    "accessLevel": "View",
    "identities": [
        {
            "username": "EffectiveIdentity",
            "roles": [ "Role1"],
            "datasets": [ "fe0a1aeb-f6a4-4b27-a2d3-b5df3bb28bdc" ]
        }
    ]
}

 

You have to replace "EffectiveIdentity" with currently logged in user's email id. And "Role1" should be replaced with the actual role name which is defined in the Power BI desktop. Dataset id (fe0a1aeb-f6a4-4b27-a2d3-b5df3bb28bdc) should replace with your report's dataset id.

 



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.