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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
daxu
Frequent Visitor

migrate power bi collection to power bi embeded

Hi,

I tried to follow the article to migrate power bi collection to power bi embedded (article link https://docs.microsoft.com/en-us/power-bi/developer/migrate-from-powerbi-embedded). However, I got stuck very quickly.

 

For example, in our app, we use this nuget package (Microsoft.PowerBI.Api and powerbi.core), and these are some of our usages:

 

client.Reports.GetReportsAsync(this.workspaceCollection, this.workspaceId)

 

client.Reports.DeleteReportAsync(this.workspaceCollection, this.workspaceId, report.Id);

 

client.Imports.PostImportFileWithHttpMessage(this.workspaceCollection,this.workspaceId,File.OpenRead(localPath), "Main Report");

client.Datasets.GetGatewayDatasourcesAsync(workspaceCollection, workspaceId, dataset.Id);

 

client.Gateways.PatchDatasourceAsync(workspaceCollection,workspaceId,datasources.Value[0].GatewayId,datasources.Value[0].Id,
delta);

 

client.Datasets.GetDatasetsAsync(workspaceCollection, workspaceId);

 

As workspace collection will be retired, will we still be able to use above methods? If not, are there any alternative functions to use?

 

Many Thanks

 

 

8 REPLIES 8
Anonymous
Not applicable

Hi @daxu,

All these could be achieved either by using the c# sdk (https://github.com/Microsoft/PowerBI-CSharp) or the PowerBI Rest Api. The sdk now provides a v2 of the functions and it's a wrapper of the Rest api. You may need to change some things but they are quite similar (workspace collection is now called group).
The new PowerBI embedded is provisioned through Azure too and it allows you to suspend the service when you don't need it. If you buy some dedicated capacity, then you can add your app workspace to it and get all the benefits.
If you'd like you can buy Powerbi premium capacity from the power bi service which will handle more demanding reports, but this is bought annually and can't be stopped.

Hope it helps.

Thanos

Hi @Anonymous

 

The sdk's documentation seems to stick to workspace collection, using the example from the package's main page

var reportsResult = await client.Reports.GetReportsAsync(workspaceCollection, workspaceId);

 

I can't see any new methods from the latest package, where are the v2 functions you are talking about?

 

Thanks

Anonymous
Not applicable

Hi @daxu,

 

here is the ReportsExtensions V2  where you can find the "GetReportsAsync" method.

 

Here is the source code for V2 (https://github.com/Microsoft/PowerBI-CSharp/tree/0d64e3c1a49eaf1718071b9ca6f000baa44bd81b/sdk/PowerB...).

 

Hope it helps.

 

Thanos

 

Hi  @Anonymous,

 

I see.

The latest nuget package (https://www.nuget.org/packages/Microsoft.PowerBI.Core) I can get is 1.1.11, which was published in April 2017. If you are the owner of the sdk, is it possible to publish a new version?

 

many Thanks

Jerry

Anonymous
Not applicable

Hi @daxu,

 

you should use the latest version of this package: https://www.nuget.org/packages/Microsoft.PowerBI.Api/

 

The PowerBI SDK is maintained by Microsoft. It would be great if I was the owner 🙂

 

Thanos

Hi @Anonymous

 

many thanks. Turned out I had these using statements in my file, As a result, I never realized there are V2 code in the package.

 

using Microsoft.PowerBI.Api.V1;
using Microsoft.PowerBI.Api.V1.Models;

Anonymous
Not applicable

Hi @daxu,

 

no worries, hope that your issue has been solved.

Please accept a reply as a solution in order to help other people to solve the same problem.

 

Regards,

 

Thanos

v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @daxu,

 

I'm afraid we can't use it in the new scenario. Please have a look at the explanations below.

1. From the #rebuild-your-application, we can see we need to use REST APIs instead, which are different from the old ones.

>>>You will need to modify your application to use the Power BI REST APIs and the report location inside powerbi.com.

 

2. The REST APIs have the similar functions and more new features. Please refer to library/mt631672.aspx.

 

3. I think the point is the Workspace collections is based on Azure while the Power BI embedded is based on Power BI Service. Please refer to embedded-faq#what-is-power-bi-workspace-collection.

Other references:

Developer/Retirement-of-workspace-collections-Questions-on-how-to-proceed/td-p/400958

blog/intro-pbi-js-api/

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.