导出 PowerBI 嵌入式报表 Forbidden

Export PowerBI embedded report Forbidden

我的 ASP.NET Core 项目中嵌入了 PowerBI 报告。该报告始终显示正确。在Microsoft documentation, I read that now it is possible to export the report in different format. So, using the example, I put together the application. You have the code in GitHub.

我遇到的问题是当我打电话时

// The 'Client' object is an instance of the Power BI .NET SDK
var export = await Client.Reports.ExportToFileInGroupAsync(
                          groupId, reportId, exportRequest);

此调用引发 操作返回无效状态代码 'Forbidden'

Active Directory 中,我拥有所有必需的权限,尤其是

此外,我尝试在文档中使用“试用”。在这种情况下,我有另一种错误

{
  "error": {
    "code": "InvalidRequest",
    "message": "Report requested for export is not on dedicated capacity"
  }
}

我该如何解决这个问题?

此 API 调用需要所谓的“dedicated capacity" to be assigned to the workspace, where the report is published. This means that you need to buy Power BI Premium (P or EM SKUs) or Power BI Embedded (A SKUs). You can read more about these in Capacity and SKUs in Power BI embedded analytics article. The bottom line is that this is quote expensive (starts from ~00/month for P and from ~5/month for A). You can buy A SKUs (A1, A2, A3, etc.) without any commitment, and pause it when it is not needed, while P and EM SKUs comes with (usually) annual commitment and you can't pause them. There is one more, recently new, option - to use Premium Per User licensing (~/month/user). Depending on the SKU, you can run different number of concurrent exports - 从 1(对于最便宜的 A1)到 24(对于最昂贵的 A6/P3 层)。其余的请求正在排队。