Forum Discussion

tareksalha's avatar
tareksalha
Frequent Visitor
1 year ago

add role member in PBI service using powershell command add-rolemember

We are developing a power bi data model using RLS with several roles included. After reviewing new developments, the model is shipped using XMLA deployment to different PROD workspaces (using pbi-tools utility) with different audiences and thus different members in the created roles per workspace.

Problem is, when deploying the dataset, all role members are deleted from the model and currently, we need to manually set them from the UI, which is prone to errors and tedious.

 

Is it possible to use Add-RoleMember (SQLServer) - SQL Server PowerShell | Microsoft Learn instead to re-add the members after deployment programmatically from our CI/CD pipeline? It is said, that the library also supports azure analysis services, thus maybe also power bi (see here: Manage Azure Analysis Services with PowerShell | Microsoft Learn)?

if it is possible, how would I connect to the model? docs only describe how to connect to on-prem-models, not azure 😕

 

thanks in advance,

Tarek

3 Replies