环境概述Environments overview

环境是 PowerApps 中的一个新概念。Environments are a new concept in PowerApps. 简单来说,环境是指用于存储、管理和共享组织中业务数据、应用和流的空间。Put simply, an environment is a space to store, manage, and share your organization’s business data, apps, and flows. 还可以将环境用作分隔具有不同角色、安全要求或目标受众的应用的容器。They also serve as containers to separate apps that may have different roles, security requirements, or target audiences. 环境的使用方式视组织和要生成的应用而定。How you choose to leverage environments depends on your organization and the apps you are trying to build. 例如:For example:

  1. 可以选择仅在一个环境中生成应用。You may choose to only build your apps in a single environment.
  2. 可以创建不同的环境,对测试版和生产版应用进行分组。You might create separate environments that group the Test and Production versions of your apps.
  3. 可以创建不同的环境,对应于公司中的特定团队或部门,每个环境包含各个受众的相关数据和应用。You might create separate environments that correspond to specific teams or departments in your company, each containing the relevant data and apps for each audience.
  4. 还可以创建不同的环境,对应于公司的其他全球分支机构。You might also create separate environments for different global branches of your company.

环境范围Environment scope

每个环境都是在 Azure AD 租户下创建的,只有相应租户中的用户才能访问环境中的资源。Each environment is created under an Azure AD tenant, and its resources can only be accessed by users within that tenant. 环境还会与地理位置(如美国)绑定。An environment is also bound to a geographic location, like the US. 在环境中创建应用后,此应用只会路由到位于该地理位置的数据中心。When you create an app in an environment, that app is routed to only datacenters in that geographic location. 在此环境中创建的所有项(包括连接、网关、使用 Microsoft Flow 的流等)也会与此环境的地理位置绑定。Any items that you create in that environment (including connections, gateways, flows using Microsoft Flow, and more) are also bound to their environment’s location.

每个环境可以有 0 或 1 个 Common Data Service 数据库,从而为应用提供存储空间。Every environment can have zero or one Common Data Service databases, which provides storage for your apps. 能否为环境创建数据库取决于你购买的 PowerApps 许可证以及你在相应环境内拥有的权限。The ability to create a database for your environment will depend on the license you purchase for PowerApps and your permission within that environment. 有关详细信息,请参阅定价信息For more information, see Pricing info.

在环境中创建应用后,此应用只能连接也在同一环境中部署的数据源,包括连接、网关、流和 Common Data Service 数据库。When you create an app in an environment, that app is only permitted to connect to the data sources that are also deployed in that same environment, including connections, gateways, flows, and Common Data Service databases. 例如,假设在一个应用场景中,你创建了两个名为“Test”和“Dev”的环境,并在每个环境中创建了 Common Data Service 数据库。For example, let’s consider a scenario where you have created two environments named ‘Test’ and ‘Dev’ and created a Common Data Service database in each of the environments. 如果你在“Test”环境中创建应用,那么此应用只能连接“Test”数据库,无法连接“Dev”数据库。If you create an app in the ‘Test’ environment, it will only be permitted to connect to the ‘Test’ database, it won't be able to connect to the ‘Dev’ database.

此外,还可以在两个环境之间移动资源。There is also a process to move resources between environments. 有关详细信息,请参阅迁移资源For more information, see Migrate resources.

环境权限Environment permissions

环境中内置两个角色,在环境中拥有相应的权限:Environments have two built-in roles that provide access to permissions within an environment:

  • 环境管理员角色可以执行所有环境管理操作,包括以下操作:The Environment Admin role can perform all administrative actions on an environment including the following:

    o 授予或撤销用户或组的“环境管理员”或“环境创建者”角色o Add or remove a user or group from either the Environment Admin or Environment Maker role

    o 为环境预配 Common Data Service 数据库o Provision a Common Data Service database for the environment

    o 查看和管理在环境中创建的所有资源o View and manage all resources created within an environment

    o 设置数据丢失防护策略。o Set data loss prevention policies. 有关详细信息,请参阅数据丢失防护策略For more information see Data loss prevention policies.

  • 环境创建者角色角色可以在环境中创建资源,包括应用、连接、自定义连接器、网关和 Microsoft Flow 流。The Environment Maker role can create resources within an environment including apps, connections, custom connectors, gateways, and flows using Microsoft Flow.

环境创建者还可以与个人用户共享自己在环境中生成的应用,从而向组织中的其他用户分发此应用,或向安全组或组织中的所有用户分发此应用。Environment Makers can also distribute the apps they build in an environment to other users in your organization by sharing the app with individual users, security groups, or to all users in the organization. 有关详细信息,请参阅在 PowerApps 中共享应用For more information, see Share an app in PowerApps.

分配到这些环境角色的用户或组并不会自动获得对环境内数据库(若有)的访问权限,必须由数据库所有者单独授予。Users or groups assigned to these environment roles are not automatically given access to the environment’s database (if it exists) and must be given access separately by a Database owner. 有关详细信息,请参阅配置数据库安全性For more information, see Configure database security.

环境管理员可以在 PowerApps 管理中心向用户或安全组分配这两个角色中的任意一个。Users or security groups can be assigned to either of these two roles by an Environment Admin from the PowerApps admin center. 有关详细信息,请参阅环境管理For more information, see Environment Administration.

默认环境The default environment

PowerApps 自动为每个租户创建一个默认环境,并由相应租户中的所有用户共享。A single default environment is automatically created by PowerApps for each tenant and shared by all users in that tenant. 只要新用户注册 PowerApps,就会自动获得默认环境的创建者角色。Whenever a new user signs up for PowerApps, they are automatically added to the Maker role of the default environment. 默认环境在离 AAD 租户的默认区域最近的区域创建。The default environment is created in the closest region to the default region of the AAD tenant.

备注

任何用户都不会自动获得默认环境的环境管理员角色。No users will be added to the Environment Admin role of the default environment automatically. 有关详细信息,请参阅环境管理For more informaton, see Environment Administration.

默认环境的命名方式如下:“{Azure AD 租户名称} (默认)”The default environment is named as follows: “{Azure AD tenant name} (default)”

选择环境Choosing an environment

随着环境的引入,你现在会在访问 https://web.powerapps.com 时获得全新的体验。站点中可见的应用、连接和其他项现在会根据当前选定的环境进行筛选。With the introduction of environments, you will now see a new experience when you come to https://web.powerapps.com. The apps, connections, and other items that are visible in the site will now be filtered based on the current environment that is selected. 当前环境在标头右侧边缘附近的环境选取器中指定。Your current environment is specified in the environment picker near the right edge of the header. 若要选择其他环境,请单击或点击选取器,查看可用环境列表。To choose a different environment, click or tap the picker, and a list of available environments appears. 单击或点击要进入的环境。Click or tap the one you wish to enter.

当你满足下列条件之一时,选取器中会显示环境:An environment will show up in your picker if you meet one of the following conditions:

  1. 你是相应环境的环境管理员角色的成员。You are a member of the Environment Admin role for the environment.
  2. 你是相应环境的环境创建者角色的成员。You are a member of the Environment Maker role for the environment.
  3. 你不是相应环境的环境管理员或环境创建者,但你拥有对相应环境中至少一个应用的“参与者”访问权限。You are not an Environment Admin or Environment Maker of the environment, but you have been given ‘Contributor’ access to at least one app within the environment. 有关详细信息,请参阅共享应用For more information, see share an app. 注意:在这种情况下,你无法在此环境中创建应用。Note: in this case, you will not be able to create apps in this environment. 只能修改已与你共享的现有应用。You will only be able to modify the existing apps that have been shared with you.

创建环境Creating an environment

谁能创建环境?Who can create environments?

你的许可证决定了你能否创建环境。Your license determines whether you can create environments.

许可证License 允许创建环境Environment creation is allowed
PowerApps P2PowerApps P2
PowerApps P2 试用版PowerApps P2 Trial
PowerApps P1PowerApps P1 xx
PowerApps P1 试用版PowerApps P1 Trial xx
Dynamics 365 计划Dynamics 365 Plans xx
Office 365 计划Office 365 Plans xx
Dynamics 365 应用和团队计划Dynamics 365 Apps and Teams Plans xx

每个用户最多可以创建两个环境。Each user can create up to two environments.

在哪里可以创建环境?Where can environments be created?

可以通过 PowerApps.comPowerApps 管理中心新建环境。You will be able to create new environments from PowerApps.com and from the PowerApps admin center. 创建环境后,你会自动获得该环境的环境管理员角色。If you create an environment, they you will automatically be added to the Environment Admin role for that environment. 作为环境管理员或环境创建者角色成员可以加入无限多个环境。There is not be a limit on the number of environments that you can be participate in as a member of the Environment Admin or Environment Maker role. 有关详细信息,请参阅环境管理For more information, see Environment Administration.

PowerApps 预览版用户会发现什么变化?What will change for PowerApps Preview users?

随着环境的引入,已加入 PowerApps 预览版的所有用户都会发现用户体验有所变化。Any user that has participated in the PowerApps preview will see some changes in their experience with the introduction of environments. 下表列出了美国和非美国用户可能会发现的变化:The following table lists what U.S. users and non-U.S. users can expect:

用户User 变化What happens
创建了 Common Data Service 数据库的预览版用户Preview user who created a Common Data Service database 你将看到名为“{你的名称} 的环境”的环境,其中包含预览版 Common Data Service 数据库,以及你针对此数据库生成的所有应用。You will see an environment called “{Your name}’s environment” that contains your preview Common Data Service database and any apps that you built against it. 你将获得此环境的环境创建者和环境管理员角色,并成为该数据库的数据库所有者。You will be added to the Environment Maker role and Environment Admin role of this environment and as a Database owner of the database. 当 PowerApps 公开上市时,我们将升级 Common Data Service 的元数据。When PowerApps enters general availability, we will upgrade the metadata of the Common Data Service. 此变化带来以下影响:仍能使用你针对预览版 Common Data Service 数据库生成的实体和应用,但无法在该数据库中创建字段或实体。The impact of this change means that you will still be able to use the entities and apps that you have already built against your preview Common Data Service database; however, you won't be able to create fields or entities in that database. 我们将很快发布指南,指导你如何创建数据库包含已升级元数据的环境,以及如何将应用迁移到此环境中。We will soon publish guidance on how you can create an environment with a database that contains the upgraded metadata and migrate your apps over to that environment.
注意:如果以预览版 Common Data Service 数据库为依据生成的任何应用还使用自定义连接器作为数据源,那么这些应用在此环境中暂时无效,因为所有自定义连接器都将迁移到默认环境中。Note: If any of your apps that were built against your preview Common Data Service database also leverage a custom connector as a data source, they will be temporarily broken in this environment because all custom connectors will be migrated to the default environment. 必须在此环境中重新创建自定义连接器,从而修复任何受影响的应用。You'll need to re-create the custom connector in this environment to repair any affected apps.
美国预览用户Preview user in the U.S. 你在 PowerApps 预览期间创建的以下资源在租户的默认环境中可用:The following resources that you created during the PowerApps preview period will be available in your tenant’s default environment:
- 创建的所有应用(不包括任何已连接预览版 Common Data Service 数据库的应用)- All apps you created (except any that connected to a preview Common Data Service database)
- 创建的所有连接和自定义连接器- All connections and custom connectors that you created
- 安装的所有本地数据网关- All on-premises data gateways you installed
非美国预览用户Preview user not in U.S. 除了默认环境外,你还将看到名为“{Azure AD 租户} (来自预览)”的环境,其中包含你在 PowerApps 预览期间创建的以下资源:In addition to the default environment, you will also see an environment called “{Azure AD tenant} (from preview)” that contains the following resources you created during the PowerApps preview period:
- 创建的所有应用(不包括任何已连接预览版 Common Data Service 数据库的应用)- All apps you created (except any that connected to a preview Common Data Service database)
- 创建的所有连接和自定义连接器- All connections and custom connectors that you created
- 安装的所有本地数据网关。- All on-premises data gateways you installed.
你将获得此环境的环境创建者角色。You will be added to the Environment Maker role of this environment.

预览用户是指 Microsoft PowerApps 公开上市 (GA) 前的用户。A preview user is someone who used Microsoft PowerApps before its release to General Availability (GA).

在 PowerApps 公开上市 (GA) 两周后,包含预览内容的环境将被标记为只读(默认环境除外);所有现有应用和流将继续在这些环境中正常运行,但你将无法创建应用或流。Two weeks after PowerApps enters general availability (GA), environments that contain preview content will be marked as read-only (with the exception of the default environment); all existing apps and flows will continue to work in these environments, but you won't be able to create apps or flows. 我们强烈建议这些环境的用户将其内容迁移到默认环境或其他自定义环境中。We highly recommend that users of these environments migrate their content to the default environment or another custom environment. 有关迁移流程的详细信息,请参阅以下博客(将在本周发布):Common Data Service 功能公告博客Please refer to the following blog (which will be posted this week) for more information about the migration process: see the Common Data Service features announcement blog.

针对美国预览用户的示例环境。Example environments for a preview user in U.S.

针对非美国预览用户的示例环境。Example environments for a preview user not in U.S.

为组织管理环境Managing environments for your organization

随着环境的引入,我们还推出了 PowerApps 管理中心。你可以在其中管理自己已创建或已获得环境管理员角色的所有环境。With the introduction of environments, we are also launching the PowerApps admin center, where you can manage all of the environments that you have created or to which you have been added to the Environment Admin role. 在管理中心内,可以执行所有环境管理操作,包括以下操作:From the Admin center, you can perform all administrative actions on an environment, including the following:

  • 授予或撤销用户或组的环境管理员或环境创建者角色。Add or remove a user or group from either the Environment Admin or Environment Maker role. 有关详细信息,请参阅环境管理For more information, see Environment Administration.
  • 为环境预配 Common Data Service 数据库。Provision a Common Data Service database for the environment. 有关详细信息,请参阅创建 Common Data Service 数据库For more information, see Create a Common Data Service database.
  • 设置数据丢失防护策略。Set Data Loss Prevention policies. 有关详细信息,请参阅数据丢失防护策略For more information, see Data loss prevention policies.
  • 设置数据库安全策略(由数据库角色设置为开放或受限)。Set database security policies (as open or restricted by database roles). 有关详细信息,请参阅配置数据库安全性For more information, see Configure database security.
  • Azure AD 租户全局管理员角色(包括 Office 365 全局管理员)的成员也可以在 PowerApps 管理中心内管理自己已在租户中创建的所有环境,并在整个租户范围内设置策略。Members of the Azure AD tenant Global administrator role (includes Office 365 Global admins) can also manage all environments that have been created in their tenant and set tenant-wide policies from the PowerApps admin center.