选择环境Choosing an environment

本文介绍 Microsoft Flow 的环境,你可以在其中创建和安全隔离流、网关、连接和其他资源。This article introduces you to Microsoft Flow environments in which you can create, and securely isolate your flows, gateways, connections, and other resources.

本文内容:You'll learn about:

  • 环境提供的功能。The features that environments provide.
  • 在环境之间切换。Switching between environments.
  • 如何在正确的环境中创建流。How to create a flow in the right environment.

环境概述Environments overview

创建某个流时,可以选择托管该流的环境以及该流使用的资源。When you create a flow, you choose an environment to host the flow and the resources the flow uses. 可以根据不同的方案使用不同的环境。You can use separate environments for different scenarios.

下面是使用环境的几种方案Here are a few scenarios for using environments

方案Scenario 建议Recommendation
需要创建一个使用 Microsoft Common Data Service 连接的流。You want to create a flow that uses a connection to the Microsoft Common Data Service. 将流和 Common Data Service 放入同一环境。Place your flow and the Common Data Service into the same environment. 这可确保所有数据都在这种环境(隔离边界)中进行隔离。This ensures all the data is isolated within that environment (isolation boundary).
需要为人力资源部创建流。You're creating a flow for your Human Resources department. 用户想要确保只有人力资源部门的用户能访问该流。You want to ensure that only users in your Human Resources department have access to the flow. 创建一个环境并只在其中添加人力资源用户。Create an environment and add only the HR users to it. 将流和流使用的其他任何资源放入此环境。Place the flow and any other resources the flow uses into this environment.
欧洲的用户需要使用流来显示 SharePoint 数据。There are users in Europe who use a flow to show SharePoint data. 在欧洲创建一个环境,然后在其中创建流和 SharePoint 连接。Create an environment in Europe, and then create your flow and the SharePoint connection in it. 此欧洲环境可为欧洲用户提供最佳性能,因为所有资源都在欧洲本地(数据地域化)。This Europe environment gives the European users the best performance, since all resources are local to Europe (data locality).

只有 Microsoft Flow 管理员才能创建环境。To create environments, you must be a Microsoft Flow administrator. 管理员可以控制谁有权访问环境。Administrators control who has access to environments. 有关如何创建和管理环境的详细信息,请参阅管理环境主题。For details on how you can create and manage environments, see the administer environments topic.

切换环境Switching environments

可以通过 Microsoft Flow 在环境之间轻松进行切换。Microsoft Flow makes it easy to switch between environments. 切换环境时,只能查看在该特定环境中创建的项,而无法查看或访问其他环境中的项。When you switch environments, you see only items that are created in that specific environment; you won't see or have access to items in any other environment.

下面是一个示例。Here's an example.

在“人力资源”环境中创建名为 NewEmployee 的流。You’ve created a flow named NewEmployee in the Human Resources environment. Microsoft Flow 中,打开“销售”环境。In Microsoft Flow, you open the Sales environment. NewEmployee 流未列出。The NewEmployee flow isn’t listed. 若要查看“NewEmployee”流,请打开“人力资源”环境。To see the NewEmployee flow, open the Human Resources environment. 请记住,同样的规则适用于在该环境中创建的其他任何项,包括连接、网关、流,等等。Remember, the same rules apply to any other items you created in the environment, including connections, gateways, flows, and more.

遵循以下步骤切换环境:Follow these steps to switch environments:

  1. 登录到 Microsoft FlowSign into Microsoft Flow.

  2. 在右上角,可以看到代表你的个人档案的图像。In the top right corner, you see an image that represents your profile.

    个人档案图像

  3. 选择该图像。Select the image. 此时,一个下拉列表会显示所有可用的环境。A drop-down list displays all the environments available to you. 当前已登录的环境已被选中:The environment in which you're currently signed in is checked:

    环境图像列表

  4. 若要切换到另一环境,请在列表中选择该环境:To switch to another environment, select that environment in the list:

    选择要切换到的环境

  5. Microsoft Flow 会切换到新环境。Microsoft Flow switches to the new environment.

在正确的环境中创建流Create flows in the right environment

创建流之前,请选择要将流及其资源添加到的环境。Before you create a flow, select the environment into which you'll add the flow and its resources.

备注

如果在错误的环境中创建了流,则需要将其删除,然后在正确的环境中创建。If you create a flow in the wrong environment, you'll have to delete it, and then create it in the correct environment.

选择用于托管流的环境时,请考虑以下因素:Consider the following factors when choosing an environment to host your flows:

  • 只能在默认环境中创建网关。You can only create gateways in the default environment. 因此,若要使用网关将流连接到本地数据,则需要使用默认环境。So, if you want to use a gateway to connect your flow to on-premises data, you'll need to use the default environment.
  • Microsoft Common Data Service 数据库已绑定到特定的环境。Microsoft Common Data Service databases are tied to a specific environment. 因此,若要创建使用 Common Data Service 的流,必须在托管该数据库的环境中创建该流。So, if you want to create a flow that uses the Common Data Service, you must create the flow in the environment that hosts the database.
  • 将会显示可在其中编辑资源的所有环境。You'll see all environments in which you can edit resources. 但是,需要请求管理员将你作为创建者添加到要在其中创建流的所有环境。However, you'll need to ask an administrator to add you as a maker to all environments in which you want to create flows.

备注

始终可以在默认环境中创建流。You'll always be able to create flows in the default environment.

后续步骤Next steps