You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Power BI Collection迁移至Embedded后旧API方法可用性及替代方案咨询

Power BI Workspace Collection to Embedded Migration: API Replacements

First off, the short answer: your old Workspace Collection-specific API methods are no longer supported, and they'll stop working entirely once Workspace Collections are retired. You'll need to migrate to the modern Power BI Embedded API (based on the workspace model) using the latest NuGet packages.

Let's break down replacements for each of your existing calls, plus key migration notes:

API Method Replacements

All new methods target a workspace ID (instead of the old workspaceCollection + workspaceId pair) and are part of the updated PowerBIClient from the latest Microsoft.PowerBI.Api package.

Old MethodNew Replacement
client.Reports.GetReportsAsync(this.workspaceCollection, this.workspaceId)client.Reports.GetReportsInGroupAsync(workspaceId)
client.Reports.DeleteReportAsync(this.workspaceCollection, this.workspaceId, report.Id)client.Reports.DeleteReportInGroupAsync(workspaceId, report.Id)
client.Imports.PostImportFileWithHttpMessage(this.workspaceCollection,this.workspaceId,File.OpenRead(localPath), "Main Report")client.Imports.PostImportFileInGroupWithHttpMessageAsync(workspaceId, File.OpenRead(localPath), "Main Report")
client.Datasets.GetGatewayDatasourcesAsync(workspaceCollection, workspaceId, dataset.Id)client.Datasets.GetGatewayDatasourcesInGroupAsync(workspaceId, dataset.Id)
client.Gateways.PatchDatasourceAsync(workspaceCollection,workspaceId,datasources.Value[0].GatewayId,datasources.Value[0].Id, delta)client.Gateways.PatchDatasourceInGroupAsync(workspaceId, gatewayId, datasourceId, delta)
client.Datasets.GetDatasetsAsync(workspaceCollection, workspaceId)client.Datasets.GetDatasetsInGroupAsync(workspaceId)

Critical Migration Notes

  1. Update NuGet Packages

    • Replace Microsoft.PowerBI.Api and powerbi.core with the latest version of Microsoft.PowerBI.Api (v3 as of now). You'll also need Microsoft.Identity.Client for Azure AD authentication, since the old Workspace Collection access keys are no longer valid.
  2. Authentication Changes

    • Instead of using a Workspace Collection access key, you'll authenticate using an Azure AD service principal (or user identity) to get an access token. Initialize your PowerBIClient with this token:
      var tokenCredentials = new TokenCredentials(accessToken, "Bearer");
      var client = new PowerBIClient(new Uri("https://api.powerbi.com/"), tokenCredentials);
      
  3. Workspace Model Shift

    • Workspace Collections have been replaced with standard Power BI workspaces in your tenant. You'll need to ensure your migrated reports/datasets are in a dedicated workspace, and use that workspace's ID for all API calls.
  4. Deprecation Timeline

    • Microsoft has already deprecated Workspace Collection APIs, and they'll be fully retired once the service is shut down. Don't rely on the old methods continuing to work—prioritize migrating to the new API as soon as possible.

内容的提问来源于stack exchange,提问作者daxu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 08:42:03