什么是 Power BI 工作区集合?What are Power BI Workspace Collections?

通过 Power BI 工作区集合,可以将 Power BI 报表集成到 Web 或移动应用程序。With Power BI Workspace Collections, you can integrate Power BI reports right into your web or mobile applications.



Power BI 工作区集合已弃用,到 2018 年 6 月 或合同指示时可用。Power BI Workspace Collections is deprecated and is available until June 2018 or when your contract indicates. 建议你规划到 Power BI Embedded 的迁移以避免应用程序中断。You are encouraged to plan your migration to Power BI Embedded to avoid interruption in your application. 有关如何将数据迁移到 Power BI Embedded 的信息,请参阅如何将 Power BI 工作区集合内容迁移到 Power BI EmbeddedFor information on how to migrate your data to Power BI Embedded, see How to migrate Power BI Workspace Collections content to Power BI Embedded.

Power BI 工作区集合是一项 Azure 服务,使 ISV 和应用程序开发人员能够在其自己的应用程序中融入 Power BI 数据体验。Power BI Workspace Collections are an Azure service that enables ISVs and app developers to surface Power BI data experiences within their applications. 开发人员已经构建了应用程序,并且这些应用程序具有其自己的用户和不同的功能集。As a developer, you've built applications, and those applications have their own users and distinct set of features. 这些应用也可能碰巧具有一些内置数据元素(如图表和报表),这些元素现在可以由 Power BI 工作区集合提供支持。Those apps may also happen to have some built-in data elements like charts and reports that can now be powered by Power BI Workspace Collections. 不需要 Power BI 帐户便可使用这些应用。You don’t need a Power BI account to use your app. 可继续像以前那样登录这些应用程序,查看并与 Power BI 报表体验进行交互,而无需任何额外的授权。You can continue to sign in to your application just like before, and view and interact with the Power BI reporting experience without requiring any additional licensing.

针对 Power BI 工作区集合进行授权Licensing for Power BI Workspace Collections

Power BI 工作区集合用法模型中,Power BI 的授权不是由最终用户负责的。In the Power BI Workspace Collections usage model, licensing for Power BI is not the responsibility of the end user. 而是应该由使用视觉对象的应用开发人员来购买 会话 ,并且费用计入拥有这些资源的订阅中。Instead, sessions are purchased by the developer of the app that is consuming the visuals, and are charged to the subscription that owns those resources.

Power BI 工作区集合概念模型Power BI Workspace Collections conceptual model


与 Azure 中的任何其他服务一样,Power BI 工作区集合的资源也是通过 Azure Resource Manager API 进行预配的。Like any other service in Azure, resources for Power BI Workspace Collections are provisioned through the Azure Resource Manager APIs. 在这种情况下,预配的资源是一个 Power BI 工作区集合In this case, the resource that is provision is a Power BI Workspace Collection.

工作区集合Workspace collection

工作区集合是一个顶级 Azure 资源容器,包含 0 个或多个工作区A Workspace Collection is the top-level Azure container for resources that contains 0 or more Workspaces. *工作区* *集合* 具有所有标准 Azure 属性和下列内容:A Workspace Collection has all of the standard Azure properties, as well as the following:

  • 访问密钥 - 安全地调用 Power BI API 时使用的密钥(后面的部分中进行了介绍)。Access Keys - Keys used when securely calling the Power BI APIs (described in a later section).
  • 用户 - 具有管理员权限的 Azure Active Directory (AAD) 用户,通过 Azure 门户或 Azure Resource Manager API 管理 Power BI 工作区集合。Users - Azure Active Directory (AAD) users that have administrator rights to manage the Power BI Workspace Collection through the Azure portal or Azure Resource Manager API.
  • 区域 - 在预配工作区集合的过程中,可以选择要在其中预配的区域。Region - As part of provisioning a Workspace Collection, you can select a region to be provisioned in. 有关详细信息,请参阅 Azure 区域For more information, see Azure Regions.


工作区是一个包含 Power BI 内容的容器,该内容可以包括数据集和报表。A Workspace is a container of Power BI content, which can include datasets and reports. 工作区在首次创建后为空。A Workspace is empty when first created. 用户将使用 Power BI Desktop 创作内容,并使用 Power BI Import API 以编程方式将 PBIX 部署到工作区中。You’ll author content using Power BI Desktop and you'll programmatically deploy the PBIX into your workspace using the Power BI Import API. 还可以通过编程方式创建数据集,并在用户的应用程序内而非使用 Power BI Desktop 创建报表。You can also programmatically create your dataset and then create reports within your application instead of using Power BI Desktop.

使用工作区集合和工作区Using workspace collections and workspaces

工作区集合工作区是内容容器,它们按最适合所生成应用程序设计的方式进行使用和组织。Workspace Collections and Workspaces are containers of content that are used and organized in whichever way best fits the design of the application you are building. 它们提供了许多不同的方式供用户在其中排列内容。There will be many different ways that you could arrange the content within them. 可以选择将所有内容都放在一个工作区中并在稍后使用应用令牌进一步细分客户之间的内容。You may choose to put all content within one workspace and then later use app tokens to further subdivide the content amongst your customers. 还可以选择将所有客户放在单独的工作区中,使他们分开一些。You may also choose to put all of your customers in separate workspaces so that there is some separation between them. 另外,也可以选择按区域而不是按客户来组织用户。Or, you may choose to organize users by region rather than by customer. 这种设计十分灵活,可以选择最佳的方式来组织内容。This flexible design allows you to choose the best way to organize content.

缓存的数据集Cached datasets

可以使用缓存的数据集。Cached datasets can be used. 但是,将缓存数据加载到 Power BI 工作区集合之后将无法刷新该数据。However, you cannot refresh cached data once it has been loaded into Power BI Workspace Collections. 缓存的数据集意味着已将数据导入到 Power BI Desktop 中而非使用 DirectQuery。A cached dataset means you have imported the data into Power BI Desktop instead of using DirectQuery.

使用应用令牌进行身份验证和授权Authentication and authorization with app tokens

Power BI 工作区集合遵从应用程序来执行所有必要的用户身份验证和授权。Power BI Workspace Collections defers to your application to perform all the necessary user authentication and authorization. 没有明确要求最终用户必须是 Azure Active directory (Azure AD) 的客户。There is no explicit requirement that your end users be customers of Azure Active Directory (Azure AD). 相反,应用程序通过使用应用程序身份验证令牌(应用令牌)Power BI 工作区集合表明自己获得了呈现 Power BI 报表的授权。Instead, your application expresses to Power BI Workspace Collections authorization to render a Power BI report by using Application Authentication Tokens (App Tokens). 当应用想要呈现报表时,可以根据需要创建这些 应用令牌These App Tokens are created as needed when your app wants to render a report.


应用程序身份验证令牌(应用令牌) 用于向 Power BI 工作区集合表明身份。Application Authentication Tokens (App Tokens) are used to authenticate against Power BI Workspace Collections. 有三种类型的 应用令牌There are three types of App Tokens:

  1. 预配令牌 - 在工作区集合中预配新的工作区时使用Provisioning Tokens - Used when provisioning a new Workspace into a Workspace Collection
  2. 开发令牌 - 直接调用 Power BI REST API 时使用Development Tokens - Used when making calls directly to the Power BI REST APIs
  3. 嵌入令牌 - 进行调用以在嵌入式 iframe 中呈现报表时使用Embedding Tokens - Used when making calls to render a report in the embedded iframe

这些令牌在与 Power BI 工作区集合进行交互的各个阶段中使用。These tokens are used for the various phases of your interactions with Power BI Workspace Collections. 这些令牌经过专门设计,以便可以将应用中的权限委托给 Power BI。The tokens are designed so that you can delegate permissions from your app to Power BI. 有关详细信息,请参阅应用令牌流For more information, see App Token Flow.

在应用程序内创建或编辑报表Create or edit reports within your application

现在,可以直接在应用程序中编辑现有报表或创建新报表,而非必须使用 Power BI Desktop。You can now edit existing reports or create new reports directly in your application without having to use Power BI Desktop. 这要求数据集存在于工作区中。This requires that a dataset exist within your workspace.

另请参阅See also

常见 Power BI 工作区集合方案Common Power BI Workspace Collections scenarios
Power BI 工作区集合入门Get started with Power BI Workspace Collections
示例入门Get started with sample
嵌入报表Embed a report
在 Power BI 工作区集合中进行身份验证和授权Authenticating and authorizing in Power BI Workspace Collections
JavaScript 嵌入示例JavaScript Embed Sample
PowerBI-CSharp Git 存储库PowerBI-CSharp Git Repo
PowerBI-Node Git 存储库PowerBI-Node Git Repo

有更多问题?More questions? 试用 Power BI 社区Try the Power BI Community