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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Shaamil
Regular Visitor

Add user to Power BI Group

I am trying to add a user to a group. My approach is to get a access tokan from the registerd app in azure AD.

I am trying the following code, but i am not sure what i should include as the resource url

 

var authenticationResult = await authenticationContext.AcquireTokenAsync(ResourceUrl, ClientId, credential);

My idea was that the resource url should be "https://analysis.windows.net/powerbi/api". But the link deosnt seem to work.

also I have used the authority url "https://login.microsoftonline.com/common/oauth2/authorize"

 I get a error saying "AADSTS70002: The request body must contain the following parameter: 'client_secret or client_assertion'"

 

I am a niebie to Power BI and Azure. I would greatly appriciate some advise on this.

5 REPLIES 5
Anonymous
Not applicable

Is there a way to create a user group within power BI itself?

Thanks,

 

Ankita

Anonymous
Not applicable

Are you trying to give them access to a Workspace?  If so you can do this through the interface.  Press the ">" next to "Workspaces".  Find the name of the workspace in the listing and press the ... menu.  In there select 'Edit Workspace' and you can add/remove members.  They will need a Pro License.

 

If you are using Workspace Apps, you will need to use the "Update App" button and grant them access in the 'Access' section.

Actually i am trying to add user through C# code from my end, so that it will get updated in the user group in power bi site.

Why too much complicated , we can do in service itself right?? Can we know what exactly you are trying

I am trying to programmatically give permission to a user for a particular dataset in power bi. Normally what we do in Power BI site is to navigate to the Workspace, select the dateset, from the popup menu select "security", from there add user in the "row level security". My clients requirement is to do the same programmatically from clients end using a web site.

 

So far I  have solved the initial error which is : "AADSTS70002: The request body must contain the following parameter: 'client_secret or client_assertion". This was because I had created a Power BI Server sideWeb app instead of a native app. Now I use a native app and I am getting a token.

 

I am getting the dataset info using the below code. But I need to access the Row level users list. Is there anyway which I can update the row level users list?

 

 //Get all Datasets of the group                   
var set = client.Datasets.GetDatasetsInGroup(GroupId);

//Get the target dataset
var targetSet = client.Datasets.GetDatasetsInGroup(GroupId).Value.Select(d=>d.Name=="ABC Reporting");

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors