Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy role also deploys role members #568

Closed
UlfenB opened this issue Aug 13, 2020 · 12 comments
Closed

Deploy role also deploys role members #568

UlfenB opened this issue Aug 13, 2020 · 12 comments
Labels
AS/PBI issue Indicates an issue in the Analysis Services engine or AMO/TOM bug Anything that is supposed to work, but doesn't.
Milestone

Comments

@UlfenB
Copy link

UlfenB commented Aug 13, 2020

I have a model created in Visual Studio with roles and RLS set up. Members are added to the roles. However, the new Power BI Premium XMLA endpoint doesn't support role members at the moment. When I try to deploy and check "Deploy Roles" but not "Deploy Role Members" Tabular Editor still tries to deploy the members resulting in an error. If I export a TMSL script I can see the role members. If I remove the members manually and run the script the deploy is working.

@otykier
Copy link
Collaborator

otykier commented Aug 19, 2020

When you check "Deploy Roles" but uncheck "Deploy Role Members", Tabular Editor populates the TMSL script with the members already defined in the destination database, instead of those that may have been defined within Tabular Editor. If we send an empty array of role members for any given role in the TMSL, Analysis Services would remove any existing members from that role upon deployment.

Now, this functionality was created for Analysis Services where it works well, and we know that adding role members through XMLA is not yet supported on the Power BI XMLA endpoint. But I'm confused about the role members that showed up in your TMSL script? To my knowledge, if you've added members through the Power BI Service UI, these members would not show up in XMLA. Indeed - they don't show up in SSMS either.

So with "Deploy Role Members" unchecked, I don't understand why you're seeing role members in the TMSL script - these must have come from the Power BI service somehow.

Even if I change the behaviour of Tabular Editor, to not include existing role members from the destination dataset when deploying to Power BI XMLA, I would have to change it back at a later point in time, once the XMLA endpoint supports adding role members. So you can probably understand why I'm a little hesitant to change this.

Could a workaround in the mean time be, that you manually remove the role members within Tabular Editor before deploying?

To make this a little easier, here's a script you can use, which will clear all roles of their members in one go:

foreach(var role in Model.Roles)
    role.ClearMembers();

@otykier otykier added the AS/PBI issue Indicates an issue in the Analysis Services engine or AMO/TOM label Aug 19, 2020
@UlfenB
Copy link
Author

UlfenB commented Aug 19, 2020

First of all - thank you Daniel for looking into the problem and for all your great work on Tabular Editor!

I agree to everything in your comment, and hopefully the XMLA endpoint will soon fully support roles and the problem goes away... But there is still one thing I find strange - I get members in the roles in the script even when deploying to an empty workspace with no model deployed before. Are the members from the bim file added if it's not possible to fetch them from the server? This is a part of the generated script:

"roles": [ { "name": "Chefer", "description": "AAD.PowerBI.Chef - Dynamisk säkerhet baserad på chefsskap i MasterData", "modelPermission": "read", "members": [ { "memberName": "AAD.PowerBI.Chef@xxxx.onmicrosoft.com", "memberId": "AAD.PowerBI.Chef@xxxx.onmicrosoft.com", "identityProvider": "AzureAD" } ], "tablePermissions": [ { "name": "Behörighet Organisation chef", "filterExpression": "'Behörighet Organisation chef'[Emailadress]=USERNAME()" } ] }
image

@otykier
Copy link
Collaborator

otykier commented Aug 19, 2020

Aha - that's a bug in the script generated when deploying a model as a new dataset (when writing my previous comment, I had only tested deployment with overwriting an existing dataset, which is a different code path). Thanks! I'll make sure this is fixed in next release.

otykier pushed a commit that referenced this issue Aug 19, 2020
@otykier otykier added this to the 2.11.8 milestone Aug 19, 2020
@otykier otykier added the bug Anything that is supposed to work, but doesn't. label Aug 19, 2020
@UlfenB
Copy link
Author

UlfenB commented Aug 19, 2020

Great! Thank's again!

@otykier
Copy link
Collaborator

otykier commented Aug 24, 2020

Fixed in 2.12.0.

@otykier otykier closed this as completed Aug 24, 2020
@saurbshnde
Copy link

@otykier , Hey Daniel - any future plans to deploy the role members data as well from tabular editor with XMLA endpoint to Power BI dataset ?

@otykier
Copy link
Collaborator

otykier commented Jan 24, 2023

@saurbshnde if your model metadata contains role members, they should already get deployed, when checking both "Deploy roles" and "Deploy role members".

@saurbshnde
Copy link

@otykier Hey Daniel, thanks with some tweaks we were able to deploy role members data too. Thanks again for prompt response.

@saurbshnde
Copy link

@otykier Hey Daniel, As we were able to succesfully convert a SSAS tabular cube to a Power BI dataset through XMLA endpoint on Tabular editor along with Role member data too.

I wanted to know does this mean that DAX logics we had written for RLS on the SSAS side will also get migrated to Power BI service and doesn't need any further tweaks ? Appreciate your support, thanks!

@otykier
Copy link
Collaborator

otykier commented Jan 25, 2023

@saurbshnde if your deployment included the roles (you can verify this by opening the Power BI dataset in Tabular Editor through XMLA), then your RLS expressions should be intact. However, I still suggest you test that the security works as expected, by impersonating a user in the Power BI service.

@saurbshnde
Copy link

@otykier Thanks Daniel, I will check this out! and keep you posted :)

@saurbshnde
Copy link

@otykier Hey Daniel, I could see that the DAX rules got deployed onto the PowerBI dataset. However on the Power BI side, I cannot see the RLS getting applied. May be an issue or some configuration miss at the POwer BI side from us.

SergioMurru pushed a commit to SergioMurru/TabularEditor that referenced this issue Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AS/PBI issue Indicates an issue in the Analysis Services engine or AMO/TOM bug Anything that is supposed to work, but doesn't.
Projects
None yet
Development

No branches or pull requests

3 participants