Forum Discussion
AD group access issue for embedded reports
- Anonymous1 year ago
Hello devJC
Thank you for your patience and for the detailed analysis you’ve provided. Based on your findings and our investigation, we can confirm that Power BI caches AD group memberships for embedded users, and this cache is only refreshed when users manually log in to the Power BI service.
Since Power BI does not provide an automatic refresh mechanism for AD group permissions in embedded scenarios, we recommend the following approaches:
Manually Remove and Re-Add the AD Group to the App Audience. This is a workaround that can be tested manually first. Removing and re-adding the AD group forces Power BI to re-evaluate group membership. If successful, proceed with automating the process using the Power BI REST API or Power Automation.
If you need any further assistance, feel free to reach out.
Thank you.
Hello devJC ,
It seems you're facing issues with user access to embedded Power BI reports, specifically regarding Azure AD group permissions and token management.
Power BI caches user permissions, and when a user logs in, their credentials and permissions are validated against the Azure AD group memberships. If new users are added to an AD group, there may be a delay before those changes take effect in Power BI due to caching. The RefreshUserPermissions API call is meant to update the user's permissions, but if it's not working as expected, it could be due to a few reasons:
- As tokens expire every 30 minutes, ensure users have a fresh token after their permissions are updated.
- If your reports use RLS, confirm that roles are correctly configured, and users have the necessary permissions to view the data.
- Verify that the AD group is properly set as an audience in the app settings and that there are no additional restrictions at the report or dataset level.
I am including a similar thread that might help you. Please have a look into it:
Solved: Powerbi Embed - user owns data - react application... - Microsoft Fabric Community
Additionally, please refer to the following documentation for a better understanding:
Permission tokens needed to embed a Power BI app - Power BI | Microsoft Learn
Troubleshoot Power BI embedded analytics application - Power BI | Microsoft Learn
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thank you.
Hi devJC ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
- devJC1 year agoFrequent Visitor
Anonymous,
I have reviewed both of your responses and I have verified each of the points. Our problem does not seem to be a token issue. Here is our token acquisition process:
- User is onboarded to AD group in advance
- After waiting several days, the user logs into the application
- Using the MSAL library for React, we request a new token with the method acquireTokenSilent and set the scope to https://analysis.windows.net/powerbi/api/.default
- Permissions present in the token are App.Read.All, Dashboard.Read.All, Dataset.Read.All, Report.Read.All, UserState.ReadWrite.All, and Workspace.Read.All
- Synchronization does not seem to be an issue since new users are able to directly log in to apps.powerbi.com and access authorized content available for their group
Still, access to embedded report is restricted:
- Reports do not use RLS, only different audiences at the App level
- Acquiring a new token days (or weeks) after being added to the AD group or after calling RefreshUserPermissions endpoint has no effect
- Users can access embedded reports normally after directly logging into apps.powerbi.com
- Users can access embedded reports weeks after being removed from the AD group and up until they directly log into apps.powerbi.com
- Users added/removed individually to the App (not AD group) do not experience the embed issue
The most likely culprit is your comment:
Power BI caches user permissions, and when a user logs in, their credentials and permissions are validated against the Azure AD group memberships.
I will be testing removing/readding the user group audience to the app in powerBI to test if that forces a refresh.
If PowerBI caches AD group members/permissions and does not automatically refresh those permissions until a user manually logs in, then this effectively breaks embedded reports that use AD groups to manage access. In response, we will require some configuration to manage an automatic refresh AD group members/permissions within PowerBI on a schedule until this problem is resolved. Are there any examples of how to accomplish this?
Thank you.- Anonymous1 year agoNot applicable
Hello devJC
Thank you for your patience and for the detailed analysis you’ve provided. Based on your findings and our investigation, we can confirm that Power BI caches AD group memberships for embedded users, and this cache is only refreshed when users manually log in to the Power BI service.
Since Power BI does not provide an automatic refresh mechanism for AD group permissions in embedded scenarios, we recommend the following approaches:
Manually Remove and Re-Add the AD Group to the App Audience. This is a workaround that can be tested manually first. Removing and re-adding the AD group forces Power BI to re-evaluate group membership. If successful, proceed with automating the process using the Power BI REST API or Power Automation.
If you need any further assistance, feel free to reach out.
Thank you.
- Anonymous1 year agoNot applicable
Hi devJC ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.