Forum Discussion

WimEling's avatar
WimEling
Regular Visitor
7 years ago

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-v2). 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

  • WimEling's avatar
    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 ? 

    • CVance's avatar
      CVance
      Frequent Visitor

      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.