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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
tareksalha
Frequent Visitor

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 3
tareksalha
Frequent Visitor

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

Anonymous
Not applicable

any further thoughts on this?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.