在 Azure 数据工厂中复制或克隆数据工厂Copy or clone a data factory in Azure Data Factory

适用于: Azure 数据工厂 Azure Synapse Analytics(预览版)

本文介绍如何在 Azure 数据工厂中复制或克隆数据工厂。This article describes how to copy or clone a data factory in Azure Data Factory.

克隆数据工厂的用例Use cases for cloning a data factory

以下可能是有助于复制或克隆数据工厂的一些情况:Here are some of the circumstances in which you may find it useful to copy or clone a data factory:

  • 将数据工厂移到新区域。Move Data Factory to a new region. 若要将数据工厂移到其他区域,最佳方法是在目标区域中创建副本,并删除现有数据工厂。If you want to move your Data Factory to a different region, the best way is to create a copy in the targeted region, and delete the existing one.

  • 重命名数据工厂Renaming Data Factory. Azure 不支持重命名资源。Azure doesn't support renaming resources. 若要重命名数据工厂,可以使用其他名称克隆该数据工厂,然后删除现有数据工厂。If you want to rename a data factory, you can clone the data factory with a different name, and delete the existing one.

  • 调试更改,在调试功能不足时进行。Debugging changes when the debug features aren't sufficient. 在大多数情况下,可以使用调试In most scenarios, you can use Debug. 在其他情况下,在克隆的沙盒环境中测试更改会更有意义。In others, testing out changes in a cloned sandbox environment makes more sense. 例如,当触发器在文件到达时触发而不是在翻转时间窗口中触发时,参数化 ETL 管道的行为可能不容易只通过调试进行测试。For instance, how your parameterized ETL pipelines would behave when a trigger fires upon file arrival versus over Tumbling time window, may not be easily testable through Debug alone. 在这些情况下,可能需要克隆沙盒环境进行试验。In these cases, you may want to clone a sandbox environment for experimenting. 由于 Azure 数据工厂主要按运行次数收费,因此第二个工厂不会产生任何额外费用。Since Azure Data Factory charges primarily by the number of runs, a second factory doesn't lead to any additional charges.

如何克隆数据工厂How to clone a data factory

  1. 首先需要从 Azure 门户创建目标数据工厂,这是先决条件。As a prerequisite, first you need to create your target data factory from the Azure portal.

  2. 如果你处于 GIT 模式下:If you are in GIT mode:

    1. 每次从门户发布时,工厂的资源管理器模板都会保存到 adf_publish 分支的 GIT 中Every time you publish from the portal, the factory's Resource Manager template is saved into GIT in the adf_publish branch
    2. 将新工厂连接到_同一_存储库,并从 adf_publish 分支进行构建。Connect the new factory to the same repository and build from adf_publish branch. 资源(如管道、数据集和触发器)将一起克隆Resources, such as pipelines, datasets, and triggers, will carry through
  3. 如果你处于实时模式:If you are in Live mode:

    1. 可以利用数据工厂 UI,将数据工厂的整个有效负载导出到资源管理器模板文件和参数文件中。Data Factory UI lets you export the entire payload of your data factory into a Resource Manager template file and a parameter file. 可以从门户中的“ARM 模板\导出资源管理器模板”按钮访问它们。They can be accessed from the ARM template \ Export Resource Manager template button in the portal.
    2. 你可以对参数文件进行适当的更改,并为新工厂换入新值You may make appropriate changes to the parameter file and swap in new values for the new factory
    3. 接下来,可以通过标准的资源管理器模板部署方法将其部署。Next, you can deploy it via standard Resource Manager template deployment methods.
  4. 如果源工厂中有 SelfHosted IntegrationRuntime,则需要在目标工厂中使用相同的名称预先创建它。If you have a SelfHosted IntegrationRuntime in your source factory, you need to precreate it with the same name in the target factory. 若要在不同工厂中共享自承载 Integration Runtime 时,可以在共享自承载 IR 时使用此处发布的模式。If you want to share the SelfHosted Integration Runtime between different factories, you can use the pattern published here on sharing SelfHosted IR.

  5. 出于安全原因,生成的资源管理器模板不会包含任何机密信息,例如链接服务的密码。For security reasons, the generated Resource Manager template won't contain any secret information, for example passwords for linked services. 因此,你需要提供凭据作为部署参数。Hence, you need to provide the credentials as deployment parameters. 如果手动输入凭据不适合你的设置,请考虑改为从 Azure Key Vault 检索连接字符串和密码。If manually inputting credential isn't desirable for your settings, please consider retrieving the connection strings and passwords from Azure Key Vault instead. 查看详细信息See more

后续步骤Next steps

使用 Azure 数据工厂 UI 创建数据工厂中查看 Azure 门户中创建数据工厂的指南。Review the guidance for creating a data factory in the Azure portal in Create a data factory by using the Azure Data Factory UI.