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
WimEling
Regular Visitor

Cannot create workspace via Power Pi Api http 500

Hello,

 

I am using the Power Bi Api to try and create a new workspace v2 (https://docs.microsoft.com/en-us/rest/api/power-bi/groups/creategroup#example-creating-a-workspace-v...). But when i try and do this i get an error http 500.

What i am doing is the following:

 

I do a http post call to https://api.powerbi.com/v1.0/myorg/groups?workspaceV2=true  with in de body of the call this:

 

{
  "name": "test"
}

but it always returns a http 500 error code 

 

with this as result 

 

48
{
  "error":{
    "code":"","message":"An error has occurred."
  }
}
0

The app registration that i use to make the call has all the permissions needed to create a workspace. And the app registration also seems to work because other calls do work correctly. 

 

What is wrong with the call and how can i debug this issue ? 

3 REPLIES 3
narayanadvl
New Member

@WimEling I am also getting the same issue. Did you find the solution?

Hi @narayanadvl ,

I would use the PowerBIClient to make the API call a little easier. The PowerBIClient is in the Microsoft.PowerBI.Api namespace. The following code works for me as long as you have a valid PowerBIClient. 

try_catch.PNG

WimEling
Regular Visitor

Maybe I should at the fact that i am using the Service Principal way to connect to the api. So i created and App Registration in Azure with the appropriate permissions. And I added the Service Principal account to the group of users that can use the Power Bi Api. And all other calls are being handled correctly so for example i have created a Workspace by hand and when I import the pbix via the api and set paramaters etc. This all works like a charm. Only creating workspaces via the Api is not working. Has anybody any information of what i am missing here ? 

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.