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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Neehar
Helper I
Helper I

Not able to Power BI Data. Ex: Get Workspaces Using Service Principal

Hi,

 

We are making changes to the existing power BI application in which we have placed username and password in the configuration file.

Now we want to use service principal.

I have followed the below steps

1) Created a client secret in the Azure portal.

2) Gave all the API permissions in the Azure

Workspace.ReadWrite.All
Workspace.Read.All

Capacity.ReadWrite.All
Capacity.Read.All

Dataset.Read.All
Dataset.ReadWrite.All

Report.ReadWrite.All
Report.Read.All

Tenant.Read.All

Tenant.ReadWrite.All

and granted admin consent.

Now when I try to call

client.Groups.GetGroupsWithHttpMessagesAsync().Result;  this always returns 0 workspaces.

Please note that I'm able to get the workspaces using my username and password.

 

Please Help.

 

 

 

1 ACCEPTED SOLUTION
Neehar
Helper I
Helper I

Fixed it By manually adding the service principal to the workspace in the assign users section in power bi 

View solution in original post

2 REPLIES 2
Neehar
Helper I
Helper I

Fixed it By manually adding the service principal to the workspace in the assign users section in power bi 

Neehar
Helper I
Helper I

 

Please note that I'm able to get workspaces using power bi rest api.

https://docs.microsoft.com/en-us/rest/api/power-bi/groups/get-groups#code-try-0

 

using Service Principal not able to the list of workspaces.

 

Please help 

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

Top Solution Authors