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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
innocence84
Helper I
Helper I

Power BI Token Generation

Hi,

 

I generated a authorization token via postman. 

Screen Shot 2023-08-21 at 1.29.15 pm.png

Then I used this token while calling the groups Rest API: (https://api.powerbi.com/v1.0/myorg/groups)

Screen Shot 2023-08-21 at 1.29.50 pm.png


But the https://api.powerbi.com/v1.0/myorg/groups Rest API call just returns one row. However there are dozens of groups/workspaces in the Power BI environment. What may be the cause of the issue?

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @innocence84 ,

You can refer the following links to grant the service principal access to the workspaces:

By Powershell:

Add-PowerBIWorkspaceUser (MicrosoftPowerBIMgmt.Workspaces) | Microsoft Learn

Add-PowerBIWorkspaceUser -Scope Organization -Id 23FCBDBD-A979-45D8-B1C8-6D21E0F4BE50 -UserEmailAddress [email protected] -AccessRight Admin

Grant the access in Power BI Service:

Enable workspace access

vyiruanmsft_0-1693302027433.png

Best Regards

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @innocence84 ,

As I tested in my side, it can return all workpaces which the account can access to. 

vyiruanmsft_0-1692767765272.png

Could you please tell me whether the account info used in the below screenshot be granted to all workspaces? 

vyiruanmsft_1-1692767853953.png

Best Regards

thanks,

I received the client_id and client_secret from Azure Active directory app registration.

You asked: "Could you please tell me whether the account info used in the below screenshot be granted to all workspaces?"
How can I grant the Azure Active Directory app registration for all workspaces?

Anonymous
Not applicable

Hi @innocence84 ,

You can refer the following links to grant the service principal access to the workspaces:

By Powershell:

Add-PowerBIWorkspaceUser (MicrosoftPowerBIMgmt.Workspaces) | Microsoft Learn

Add-PowerBIWorkspaceUser -Scope Organization -Id 23FCBDBD-A979-45D8-B1C8-6D21E0F4BE50 -UserEmailAddress [email protected] -AccessRight Admin

Grant the access in Power BI Service:

Enable workspace access

vyiruanmsft_0-1693302027433.png

Best Regards

innocence84
Helper I
Helper I

Hi again,

I checked Azure portal and Power BI admin portal. I could not find any settings that corresponds an app registration and a Power BI workspace.
Is there any configurating for granting access to a Power BI workspace for the given Azure Active Directory app registration?  How should we model analysis like license consumption? 

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.