Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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
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
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
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;
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
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
Best Regards,
Dale