Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
Hi @Anonymous,
unfortunately, the links provided are not very helpful. Let me explain why:
Quickstart - Create Azure Analysis Services using PowerShell Azure Analysis Services | Microsoft Lea... This tutorial uses powershell module az.analysisservices, that uses std auth mechanism to azure, so far so good. But this module does not provide any command to alter database users (see here: Az.AnalysisServices Module | Microsoft Learn)
-> not usable
Add-RoleMember (SQLServer) - SQL Server PowerShell | Microsoft Learn is the very same link I provided in my question. This resource does not provide insights on how to authenticate to power bi as mentioned in my question. Ones authenticated, I would prefer this method.
-> not helpful
Add SSAS Role Members via PowerShell or XMLA I also saw this link before and it shows on how to use Add-Rolemember, which is good. Unfortunately, it does not show any how-to on how to apply this to azure/power bi. It is showing only for on-prem sql server.
-> only partly helpful
Would it make sense to open a support ticket on this instead?
Regards, Tarek
Hi @tareksalha ,
Please review the following links, hope they can help you.
Add-RoleMember (SQLServer) - SQL Server PowerShell | Microsoft Learn
Add SSAS Role Members via PowerShell or XMLA
Best Regards
any further thoughts on this?
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!