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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
mohitkumawat
Impactful Individual
Impactful Individual

how we can add user in RLS and app through Power BI REST API

Hi, 

 

how we can  implement or Add user in RLS Power BI  via REST API,

i found some of scanner API but it give us only Get Access.

 

how could implement this ?

 

Thank you for your support.

 

1 ACCEPTED SOLUTION
NandanHegde
Super User
Super User

Hey,

based on my knowlegde, there is no REST API support as of today to add users/groups within RLS in power BI




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thanks for the reply from Jai-Rathinavel and NandanHegde , please allow me to provide another insight:

Hi, @mohitkumawat 

 Could you please let me know if the responses from Jai-Rathinavel and NandanHegde  have resolved your issue?If it did, kindly accept it as the solution.

vlinyulumsft_0-1732850820674.png

I agree with their suggestion; PowerShell is a good alternative. However, please note that you cannot directly add users to RLS via the PowerShell API. Here is a link to the relevant issue:

Solved: How to add a member to a RLS via Power Shell, API ... - Microsoft Fabric Community
 

Therefore, you need to first create a security group and then automatically add users from, for example, a CSV file to the security group. Below is a sample code:

# Start transcript
Start-Transcript -Path C:\Temp\Add-ADUsers.log -Append

# Import AD Module
Import-Module ActiveDirectory

# Import the data from CSV file and assign it to variable
$Users = Import-Csv "C:\Temp\Users.csv"

# Specify target group name (pre-Windows 2000) where the users will be added to
# You can add the distinguishedName of the group. For example: CN=Pilot,OU=Groups,OU=Company,DC=exoip,DC=local
$Group = "Pilot"

foreach ($User in $Users) {
    # Retrieve UPN
    $UPN = $User.UserPrincipalName

    # Retrieve UPN related SamAccountName
    $ADUser = Get-ADUser -Filter "UserPrincipalName -eq '$UPN'" | Select-Object SamAccountName

    # User from CSV not in AD
    if ($ADUser -eq $null) {
        Write-Host "$UPN does not exist in AD" -ForegroundColor Red
    }
    else {
        # Retrieve AD user group membership
        $ExistingGroups = Get-ADPrincipalGroupMembership $ADUser.SamAccountName | Select-Object Name

        # User already member of group
        if ($ExistingGroups.Name -eq $Group) {
            Write-Host "$UPN already exists in $Group" -ForeGroundColor Yellow
        }
        else {
            # Add user to group
            Add-ADGroupMember -Identity $Group -Members $ADUser.SamAccountName -WhatIf
            Write-Host "Added $UPN to $Group" -ForeGroundColor Green
        }
    }
}
Stop-Transcript

For further details, please refer to:

 Solved: Adding users to role on power bi service automatic... - Microsoft Fabric Community
Add users to group with PowerShell - ALI TAJRAN
https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal?tabs=azure-por...
New-MgGroupMember: Add Members to Groups Easily | M365Corner

Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Jai-Rathinavel
Super User
Super User

@mohitkumawat You can add members to the role via powershell cmdlet but not via Power BI Rest APIs at moment.


Thanks,

Jai

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





NandanHegde
Super User
Super User

Hey,

based on my knowlegde, there is no REST API support as of today to add users/groups within RLS in power BI




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors