0
votes

I have a powerBI embedded into a web application. The app contains a feature to create new reports as well that will save it into a workspace with the specified dataset.

The new experience workspaces came up with the dataset sharing capability, that'll enable users to create reports across multiple workspaces but using the dataset from one workspace. I've used the GenerateTokenRequestV2 to generate the embed token and used the Microsoft client library for JS PowerBI-Client to embed the same.

Am able to successfully embed and work on creating the report with the specified dataset, but there is an error thrown up on trying to save the report. The network tab shows a call with endpoint "https://wabi-west.../explore/explorations?name={Report Name}" returning 403 status code.

The config sent to powerbi-client library:

{
      type: 'report',
      tokenType: 1,
      accessToken: '__access_token__',
      embedUrl 'https://app.powerbi.com/reportEmbed',
      datasetId: '__shared_datasetID__',
      groupId: '__target_workspaceID__',
}

Any help appreciated. Thanks in advance. 

2

2 Answers

5
votes

There can be 2 issues here.

Missing Scopes

Please check whether your AAD app has the scopes you need for saving the report. You need Report.ReadWriteAll and Dataset.ReadWriteAll.

You can change the permissions from here Azure Portal by going in the App registrations.

Update the permissions and try again.

Role Level

As a user of new PowerBI V2 workspace, please check that you are not having a viewer level role because it gives only a read-only experience to it's users. You won't be able to save the reports and the API will give you 403 which is the Forbidden error.

0
votes

There are a list of limitations with using a shared dataset in embedded report creation mode as per the original documentation.