使用 Power BI 嵌入Embedding with Power BI

Power BI 提供用于将仪表板和报表嵌入应用的 API。Power BI offers APIs for embedding your dashboards and reports into applications. 在嵌入内容时,Power BI API 提供一组固定不变的功能,并提供对最新 Power BI 功能(如仪表板、网关和应用工作区)的访问权限。The Power BI APIs offer a consistent set of capabilities and access to the latest Power BI features – such as dashboards, gateways and app workspaces – when embedding content.

单个 APIA single API

嵌入 Power BI 内容时,有两个主要方案。There are two main scenarios when embedding Power BI content. 为组织中的用户(拥有 Power BI 许可证)嵌入内容;为用户和客户嵌入内容且不要求他们拥有 Power BI 许可证。Embedding for users in your organization (who have licenses for Power BI) and embedding for your users and customers without requiring them to have Power BI licenses. 两种方案都可使用 Power BI REST API。The Power BI REST API allows for both scenarios.

对于没有 Power BI 许可证的客户和用户,可以使用同一 API 为组织或客户提供服务,将仪表板和报表嵌入自定义应用程序中。For customers and users without Power BI licenses, you can embed dashboards and reports into your custom application, using the same API to either service your organization or your customers. 客户会看到该应用程序管理的数据。Your customers see the data that is managed by the application. 对于组织中的 Power BI 用户,他们可以直接在 Power BI 中或者在嵌入式应用程序的上下文中使用附加的选项来查看他们自己的数据。And for Power BI users in your organization, they'll have the additional options to view their own data directly in Power BI or in the context of the embedded application. 可以充分利用 JavaScript 和 REST API 的功能以满足你的嵌入需要。You can take full advantage of the JavaScript and REST APIs for your embedding needs.

若要查看有关嵌入工作原理的示例,请参阅 JavaScript 嵌入示例To view a sample of how embedding works, see the JavaScript embed sample.

为组织嵌入内容Embedding for your organization

通过为组织嵌入内容,可以扩展 Power BI 服务。Embedding for your organization allows you to extend the Power BI service. 应用程序的用户在查看其内容时必须登录到 Power BI 服务。This requires that users of your application sign into the Power BI service when they want to view their content. 组织中的用户登录后,只能访问他们拥有的,或者在 Power BI 服务中与之共享的仪表板和报表。Once someone in your organization signs in, they will only have access to dashboards and reports that they own or that have been shared with them in the Power BI service.

为组织嵌入内容的示例包括内部 Web 应用、SharePoint Online Web 部件和 Microsoft Teams 集成。Examples of embedding for your organization include internal web application, the SharePoint Online web part and Microsoft Teams integration.

若要为组织嵌入内容,请参阅以下演练:For embedding for your organization, see the following:

为 Power BI 用户进行嵌入时,通过 JavaScript API 可使用编辑和保存等自助服务功能。Self-service capabilities, such as edit, save and more, are available through the JavaScript API when embedding for Power BI users.

为客户嵌入内容Embedding for your customers

通过为客户嵌入内容,可为没有 Power BI 帐户的用户嵌入仪表板和报表。Embedding for your customers provides the ability to embed dashboards and reports to users who don't have an account for Power BI. 客户无需了解有关 Power BI 的一切。Your customers don't need to know anything about Power BI. 至少需要有一个 Power BI Pro 帐户才能创建嵌入式应用程序。At least one Power BI Pro account is needed to create an embedded application. Power BI Pro 帐户充当应用程序的主帐户。The Power BI Pro account acts as a master account for your application. 将其视为代理帐户。Think of this as a proxy account. 借助 Power BI Pro 帐户,还可以生成嵌入令牌,用于访问应用程序拥有/管理的 Power BI 服务中的仪表板和报表。The Power BI Pro account also allows you to generate embed tokens that provide access to dashboards and reports within the Power BI service that are owned/managed by your application.

为客户嵌入内容的示例是,出售给其他公司的 ISV 应用。An example of embedding for your customers is an ISV application being sold to other companies.

为客户嵌入内容的嵌入流

若要嵌入仪表板、报表和磁贴,使用的 API 与为组织嵌入内容时使用的 API 相同。To embed dashboards, reports and tiles, you would use the same APIs that you would use for embedding for your organization.

重要

尽管嵌入操作依赖于 Power BI 服务,但在为客户嵌入内容时并不依赖于 Power BI Pro。While embedding has a dependency on the Power BI service, there is not a dependency on Power BI for your customers. 用户不需要注册 Power BI 来查看应用程序中嵌入的内容。They do not need to sign up for Power BI to view the embedded content in your application.

准备迁移到生产环境时,必须为应用工作区分配容量。When you are ready to move to production, your app workspace must be assigned to a capacity. Microsoft Azure 中的 Power BI Embedded 提供对应用使用的容量。Power BI Embedded, within Microsoft Azure, offers capacity to use with your applications.

有关嵌入方法的详细信息,请参阅如何嵌入 Power BI 仪表板、报表和磁贴For details on how to embed, see How to embed your Power BI dashboards, reports and tiles.

如果使用的是 Power BI 工作区集合 Azure 服务,请参阅从 Power BI 工作区集合 Azure 服务迁移内容,了解如何迁移内容。If you were using the Power BI Workspace Collections service within Azure, see Migrate content from the Power BI Workspace Collections Azure service for information on how to migrate your content over.

后续步骤Next steps

如何嵌入 Power BI 仪表板、报表和磁贴How to embed your Power BI dashboards, reports and tiles
如何将 Power BI Embedded 工作区集合内容迁移到 Power BIHow to migrate Power BI Embedded workspace collection content to Power BI
什么是 Power BI Premium?Power BI Premium - what is it?
JavaScript API Git 存储库JavaScript API Git repo
Power BI C# Git 存储库Power BI C# Git repo
JavaScript 嵌入示例JavaScript embed sample
嵌入式分析容量规划白皮书Embedded analytics capacity planning whitepaper
Power BI Premium 白皮书Power BI Premium whitepaper

更多问题?More questions? 尝试咨询 Power BI 社区Try asking the Power BI Community