您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

在 Azure 数据工厂中使用“执行 SSIS 包”活动运行 SSIS 包Run an SSIS package with the Execute SSIS Package activity in Azure Data Factory

适用于:是 Azure 数据工厂否 Azure Synapse Analytics(预览版)APPLIES TO: yesAzure Data Factory noAzure Synapse Analytics (Preview)

本文介绍如何使用“执行 SSIS 包”活动在 Azure 数据工厂管道中运行 SQL Server Integration Services (SSIS) 包。This article describes how to run a SQL Server Integration Services (SSIS) package in an Azure Data Factory pipeline by using the Execute SSIS Package activity.

先决条件Prerequisites

备注

本文进行了更新,以便使用新的 Azure PowerShell Az 模块。This article has been updated to use the new Azure PowerShell Az module. 你仍然可以使用 AzureRM 模块,至少在 2020 年 12 月之前,它将继续接收 bug 修补程序。You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. 若要详细了解新的 Az 模块和 AzureRM 兼容性,请参阅新 Azure Powershell Az 模块简介To learn more about the new Az module and AzureRM compatibility, see Introducing the new Azure PowerShell Az module. 有关 Az 模块安装说明,请参阅安装 Azure PowerShellFor Az module installation instructions, see Install Azure PowerShell.

如果还没有 Azure-SSIS Integration Runtime (IR),请按照以下文章中的分步说明创建 IR:教程:预配 Azure-SSIS IRCreate an Azure-SSIS integration runtime (IR) if you don't have one already by following the step-by-step instructions in the Tutorial: Provisioning Azure-SSIS IR.

在 Azure 门户中运行包Run a package in the Azure portal

在本部分中,我们将使用数据工厂用户界面 (UI) 或应用来创建一个数据工厂管道,其中包含可运行 SSIS 包的“执行 SSIS 包”活动。In this section, you use the Data Factory user interface (UI) or app to create a Data Factory pipeline with an Execute SSIS Package activity that runs your SSIS package.

使用“执行 SSIS 包”活动创建管道Create a pipeline with an Execute SSIS Package activity

此步骤使用数据工厂 UI 或应用创建管道。In this step, you use the Data Factory UI or app to create a pipeline. 将“执行 SSIS 包”活动添加到管道,并将该活动配置为运行 SSIS 包。You add an Execute SSIS Package activity to the pipeline and configure it to run your SSIS package.

  1. 在 Azure 门户中的数据工厂概述或主页上,选择“创作和监视”磁贴,在单独的选项卡中启动数据工厂 UI 或应用。On your Data Factory overview or home page in the Azure portal, select the Author & Monitor tile to start the Data Factory UI or app in a separate tab.

    数据工厂主页

    在“开始使用”页中,选择“创建管道”。 On the Let's get started page, select Create pipeline.

    “入门”页

  2. 在“活动”工具箱中,展开“常规”。In the Activities toolbox, expand General. 然后将“执行 SSIS 包”活动拖到管道设计图面上。Then drag an Execute SSIS Package activity to the pipeline designer surface.

    将“执行 SSIS 包”活动拖到设计面

    选择“执行 SSIS 包”活动对象,以配置其“常规”、“设置”、“SSIS 参数”、“连接管理器”和“属性替代”选项卡。Select the Execute SSIS Package activity object to configure its General, Settings, SSIS Parameters, Connection Managers, and Property Overrides tabs.

“常规”选项卡General tab

在“执行 SSIS 包”活动的“常规”选项卡上,完成以下步骤。On the General tab of Execute SSIS Package activity, complete the following steps.

在“常规”选项卡上设置属性

  1. 对于“名称”,请输入你的“执行 SSIS 包”活动的名称。For Name, enter the name of your Execute SSIS Package activity.

  2. 对于“说明”,请输入你的“执行 SSIS 包”活动的说明。For Description, enter the description of your Execute SSIS Package activity.

  3. 对于“超时”,请输入你的“执行 SSIS 包”活动可以运行的最长时间。For Timeout, enter the maximum amount of time your Execute SSIS Package activity can run. 默认值为 7 天,格式为 D.HH:MM:SS。Default is 7 days, format is D.HH:MM:SS.

  4. 对于“重试”,请输入你的“执行 SSIS 包”活动的最大重试次数。For Retry, enter the maximum number of retry attempts for your Execute SSIS Package activity.

  5. 对于“重试间隔”,请输入你的“执行 SSIS 包”活动的每次重试之间的秒数。For Retry interval, enter the number of seconds between each retry attempt for your Execute SSIS Package activity. 默认值为 30 秒。Default is 30 seconds.

  6. 选中“安全输出”复选框,以选择是否要从日志记录中排除“执行 SSIS 包”活动的输出。Select the Secure output check box to choose whether you want to exclude the output of your Execute SSIS Package activity from logging.

  7. 选中“安全输入”复选框,以选择是否要从日志记录中排除“执行 SSIS 包”活动的输入。Select the Secure input check box to choose whether you want to exclude the input of your Execute SSIS Package activity from logging.

“设置”选项卡Settings tab

在“执行 SSIS 包”活动的“设置”选项卡上,完成以下步骤。On the Settings tab of Execute SSIS Package activity, complete the following steps.

在“设置”选项卡上设置属性 - 自动

  1. 对于“Azure-SSIS IR”,请选择指定的 Azure-SSIS IR 以运行“执行 SSIS 包”活动。For Azure-SSIS IR, select the designated Azure-SSIS IR to run your Execute SSIS Package activity.

  2. 对于“说明”,请输入你的“执行 SSIS 包”活动的说明。For Description, enter the description of your Execute SSIS Package activity.

  3. 选中“Windows 身份验证”复选框以选择是否要使用 Windows 身份验证来访问数据存储,例如本地的 SQL Server/文件共享,或 Azure 文件存储。Select the Windows authentication check box to choose whether you want to use Windows authentication to access data stores, such as SQL servers/file shares on-premises or Azure Files.

    如果选中此复选框,请在“域”、“用户名”和“密码”框中输入包执行凭据的值。 If you select this check box, enter the values for your package execution credentials in the Domain, Username, and Password boxes. 例如,若要访问 Azure 文件存储,则域为 Azure,用户名为 <storage account name>,密码为 <storage account key>For example, to access Azure Files, the domain is Azure, the username is <storage account name>, and the password is <storage account key>.

    另外,还可以将 Azure Key Vault 中存储的机密用作其值。Alternatively, you can use secrets stored in your Azure Key Vault as their values. 为此,请选中它们旁边的“AZURE KEY VAULT”复选框。To do so, select the AZURE KEY VAULT check box next to them. 选择或编辑现有的 Key Vault 链接服务,或创建新的链接服务。Select or edit your existing key vault linked service or create a new one. 然后,针对你的值选择机密名称和版本。Then select the secret name and version for your value. 创建或编辑 Key Vault 链接服务时,可以选择或编辑现有的 Key Vault,或创建新的 Key Vault。When you create or edit your key vault linked service, you can select or edit your existing key vault or create a new one. 请务必授予数据工厂托管标识对 Key Vault 的访问权限(如果尚未这样做)。Make sure to grant Data Factory managed identity access to your key vault if you haven't done so already. 此外,还可以采用以下格式直接输入机密:<key vault linked service name>/<secret name>/<secret version>You can also enter your secret directly in the following format: <key vault linked service name>/<secret name>/<secret version>.

  4. 选中“32 位运行时”复选框以选择你的包是否需要 32 位运行时才能运行。Select the 32-Bit runtime check box to choose whether your package needs 32-bit runtime to run.

  5. 对于“包位置”,请选择“SSISDB”、“文件系统(包)”、“文件系统(项目)”、“嵌入包”或“包存储”。 For Package location, select SSISDB, File System (Package), File System (Project), Embedded package, or Package store.

包位置:SSISDBPackage location: SSISDB

如果为 Azure-SSIS IR 预配了 Azure SQL 数据库服务器/托管实例托管的 SSIS 目录 (SSISDB),则会自动选择“SSISDB”作为包位置,否则,你可以自己选择位置。SSISDB as your package location is automatically selected if your Azure-SSIS IR was provisioned with an SSIS catalog (SSISDB) hosted by Azure SQL Database server/Managed Instance or you can select it yourself. 如果选择了该位置,请完成以下步骤。If it's selected, complete the following steps.

  1. 如果 Azure-SSIS IR 正在运行且“手动输入内容”复选框处于已清除状态,可以从 SSISDB 浏览并选择现有的文件夹、项目、包和环境。If your Azure-SSIS IR is running and the Manual entries check box is cleared, browse and select your existing folders, projects, packages, and environments from SSISDB. 选择“刷新”以从 SSISDB 获取新添加的文件夹、项目、包或环境,以便可以浏览和选择这些内容。Select Refresh to fetch your newly added folders, projects, packages, or environments from SSISDB, so that they're available for browsing and selection. 若要浏览并选择用于包执行的环境,必须事先配置项目,以便从 SSISDB 下的相同文件夹中添加这些环境作为引用。To browse and select the environments for your package executions, you must configure your projects beforehand to add those environments as references from the same folders under SSISDB. 有关详细信息,请参阅创建和映射 SSIS 环境For more information, see Create and map SSIS environments.

  2. 对于“日志记录级别”,请为包执行选择预定义的日志记录范围。For Logging level, select a predefined scope of logging for your package execution. 如果要改为输入自定义日志记录名称,请选中“自定义”复选框。Select the Customized check box if you want to enter your customized logging name instead.

  3. 如果 Azure-SSIS IR 未在运行或“手动输入内容”复选框处于选中状态,请采用以下格式直接在 SSISDB 中输入你的包和环境路径:<folder name>/<project name>/<package name>.dtsx<folder name>/<environment name>If your Azure-SSIS IR isn't running or the Manual entries check box is selected, enter your package and environment paths from SSISDB directly in the following formats: <folder name>/<project name>/<package name>.dtsx and <folder name>/<environment name>.

在“设置”选项卡上设置属性 - 手动

包位置:文件系统(包)Package location: File System (Package)

如果没有为 Azure-SSIS IR 预配 SSISDB,则会自动选择“文件系统(包)”作为包位置,否则,你可以自己选择它。File System (Package) as your package location is automatically selected if your Azure-SSIS IR was provisioned without SSISDB or you can select it yourself. 如果选择了该位置,请完成以下步骤。If it's selected, complete the following steps.

在“设置”选项卡上设置属性 - 文件系统(包)

  1. 指定要运行的包,方法是在“包路径”框中提供包文件(带扩展名 .dtsx)的通用命名约定 (UNC) 路径。Specify your package to run by providing a Universal Naming Convention (UNC) path to your package file (with .dtsx) in the Package path box. 你可以通过选择“浏览文件存储”来浏览并选择包,也可以手动输入其路径。You can browse and select your package by selecting Browse file storage or enter its path manually. 例如,如果你将包存储在 Azure 文件存储中,则其路径为 \\<storage account name>.file.core.windows.net\<file share name>\<package name>.dtsxFor example, if you store your package in Azure Files, its path is \\<storage account name>.file.core.windows.net\<file share name>\<package name>.dtsx.

  2. 如果在单独的文件中配置包,则还需要在“配置路径”框中提供配置文件(带扩展名 .dtsConfig)的 UNC 路径。If you configure your package in a separate file, you also need to provide a UNC path to your configuration file (with .dtsConfig) in the Configuration path box. 你可以通过选择“浏览文件存储”来浏览并选择配置,也可以手动输入其路径。You can browse and select your configuration by selecting Browse file storage or enter its path manually. 例如,如果将配置存储在 Azure 文件存储中,则其路径为 \\<storage account name>.file.core.windows.net\<file share name>\<configuration name>.dtsConfigFor example, if you store your configuration in Azure Files, its path is \\<storage account name>.file.core.windows.net\<file share name>\<configuration name>.dtsConfig.

  3. 指定用于访问你的包和配置文件的凭据。Specify the credentials to access your package and configuration files. 如果你先前已输入包执行凭据的值(对于 Windows 身份验证),则可以通过选中“与包执行凭据相同”复选框来重复使用这些值。If you previously entered the values for your package execution credentials (for Windows authentication), you can reuse them by selecting the Same as package execution credentials check box. 否则,请在“域”、“用户名”和“密码”框中输入包访问凭据的值。 Otherwise, enter the values for your package access credentials in the Domain, Username, and Password boxes. 例如,如果你将包和配置存储在 Azure 文件存储中,则域为 Azure,用户名为 <storage account name>,密码为 <storage account key>For example, if you store your package and configuration in Azure Files, the domain is Azure, the username is <storage account name>, and the password is <storage account key>.

    另外,还可以将 Azure Key Vault 中存储的机密用作其值。Alternatively, you can use secrets stored in your Azure Key Vault as their values. 为此,请选中它们旁边的“AZURE KEY VAULT”复选框。To do so, select the AZURE KEY VAULT check box next to them. 选择或编辑现有的 Key Vault 链接服务,或创建新的链接服务。Select or edit your existing key vault linked service or create a new one. 然后,针对你的值选择机密名称和版本。Then select the secret name and version for your value. 创建或编辑 Key Vault 链接服务时,可以选择或编辑现有的 Key Vault,或创建新的 Key Vault。When you create or edit your key vault linked service, you can select or edit your existing key vault or create a new one. 请务必授予数据工厂托管标识对 Key Vault 的访问权限(如果尚未这样做)。Make sure to grant Data Factory managed identity access to your key vault if you haven't done so already. 此外,还可以采用以下格式直接输入机密:<key vault linked service name>/<secret name>/<secret version>You can also enter your secret directly in the following format: <key vault linked service name>/<secret name>/<secret version>.

    这些凭据还用于访问“执行包任务”中通过其自己的路径和包中指定的其他配置引用的子包。These credentials are also used to access your child packages in Execute Package Task that are referenced by their own path and other configurations specified in your packages.

  4. 如果在通过 SQL Server Data Tools (SSDT) 创建包时使用了 EncryptAllWithPasswordEncryptSensitiveWithPassword 保护级别,请在“加密密码”框中输入密码的值。If you used the EncryptAllWithPassword or EncryptSensitiveWithPassword protection level when you created your package via SQL Server Data Tools (SSDT), enter the value for your password in the Encryption password box. 另外,还可以将 Azure Key Vault 中存储的机密用作其值(参阅上文)。Alternatively, you can use a secret stored in your Azure Key Vault as its value (see above).

    如果使用了 EncryptSensitiveWithUserKey 保护级别,请在配置文件中或在“SSIS 参数”、“连接管理器”或“属性替代”选项卡上重新输入敏感值(参阅下文)。 If you used the EncryptSensitiveWithUserKey protection level, reenter your sensitive values in configuration files or on the SSIS Parameters, Connection Managers, or Property Overrides tabs (see below).

    不支持使用 EncryptAllWithUserKey 保护级别。If you used the EncryptAllWithUserKey protection level, it's unsupported. 需要通过 SSDT 或 dtutil 命令行实用程序将包重新配置为使用另一保护级别。You need to reconfigure your package to use another protection level via SSDT or the dtutil command-line utility.

  5. 对于“日志记录级别”,请为包执行选择预定义的日志记录范围。For Logging level, select a predefined scope of logging for your package execution. 如果要改为输入自定义日志记录名称,请选中“自定义”复选框。Select the Customized check box if you want to enter your customized logging name instead.

  6. 若要记录包执行但不使用可在包中指定的标准日志提供程序,请通过在“日志记录路径”框中提供其 UNC 路径来指定日志文件夹。If you want to log your package executions beyond using the standard log providers that can be specified in your package, specify your log folder by providing its UNC path in the Logging path box. 你可以通过选择“浏览文件存储”来浏览并选择日志文件夹,也可以手动输入其路径。You can browse and select your log folder by selecting Browse file storage or enter its path manually. 例如,如果将日志存储在 Azure 文件存储中,则日志记录路径为 \\<storage account name>.file.core.windows.net\<file share name>\<log folder name>For example, if you store your logs in Azure Files, your logging path is \\<storage account name>.file.core.windows.net\<file share name>\<log folder name>. 将在此路径中为每个包运行创建一个与“执行 SSIS 包”活动运行 ID 同名的子文件夹,每隔 5 分钟在其中生成一次日志文件。A subfolder is created in this path for each individual package run, named after the Execute SSIS Package activity run ID, and in which log files are generated every five minutes.

  7. 指定用于访问日志文件夹的凭据。Specify the credentials to access your log folder. 如果先前已输入包访问凭据的值(参阅上文),则可以通过选中“与包访问凭据相同”复选框来重复使用这些值。If you previously entered the values for your package access credentials (see above), you can reuse them by selecting the Same as package access credentials check box. 否则,请在“域”、“用户名”和“密码”框中输入日志记录访问凭据的值。 Otherwise, enter the values for your logging access credentials in the Domain, Username, and Password boxes. 例如,如果将日志存储在 Azure 文件存储中,则域为 Azure,用户名为 <storage account name>,密码为 <storage account key>For example, if you store your logs in Azure Files, the domain is Azure, the username is <storage account name>, and the password is <storage account key>. 另外,还可以将 Azure Key Vault 中存储的机密用作其值(参阅上文)。Alternatively, you can use secrets stored in your Azure Key Vault as their values (see above).

对于上述所有 UNC 路径,完全限定的文件名必须短于 260 个字符。For all UNC paths previously mentioned, the fully qualified file name must be fewer than 260 characters. 目录名称必须短于 248 个字符。The directory name must be fewer than 248 characters.

包位置:文件系统(项目)Package location: File System (Project)

如果选择“文件系统(项目)”作为包位置,请完成以下步骤。If you select File System (Project) as your package location, complete the following steps.

在“设置”选项卡上设置属性 - 文件系统(项目)

  1. 通过在“项目路径”框中提供项目文件(带 .ispac 扩展名)的 UNC 路径,并在“包名称”框中提供项目中某个包文件(带 .dtsx 扩展名)的 UNC 路径,来指定要运行的包。 Specify your package to run by providing a UNC path to your project file (with .ispac) in the Project path box and a package file (with .dtsx) from your project in the Package name box. 你可以通过选择“浏览文件存储”来浏览并选择项目,也可以手动输入其路径。You can browse and select your project by selecting Browse file storage or enter its path manually. 例如,如果将项目存储在 Azure 文件存储中,则其路径为 \\<storage account name>.file.core.windows.net\<file share name>\<project name>.ispacFor example, if you store your project in Azure Files, its path is \\<storage account name>.file.core.windows.net\<file share name>\<project name>.ispac.

  2. 指定用于访问项目和包文件的凭据。Specify the credentials to access your project and package files. 如果你先前已输入包执行凭据的值(对于 Windows 身份验证),则可以通过选中“与包执行凭据相同”复选框来重复使用这些值。If you previously entered the values for your package execution credentials (for Windows authentication), you can reuse them by selecting the Same as package execution credentials check box. 否则,请在“域”、“用户名”和“密码”框中输入包访问凭据的值。 Otherwise, enter the values for your package access credentials in the Domain, Username, and Password boxes. 例如,如果你将项目和包存储在 Azure 文件存储中,则域为 Azure,用户名为 <storage account name>,密码为 <storage account key>For example, if you store your project and package in Azure Files, the domain is Azure, the username is <storage account name>, and the password is <storage account key>.

    另外,还可以将 Azure Key Vault 中存储的机密用作其值。Alternatively, you can use secrets stored in your Azure Key Vault as their values. 为此,请选中它们旁边的“AZURE KEY VAULT”复选框。To do so, select the AZURE KEY VAULT check box next to them. 选择或编辑现有的 Key Vault 链接服务,或创建新的链接服务。Select or edit your existing key vault linked service or create a new one. 然后,针对你的值选择机密名称和版本。Then select the secret name and version for your value. 创建或编辑 Key Vault 链接服务时,可以选择或编辑现有的 Key Vault,或创建新的 Key Vault。When you create or edit your key vault linked service, you can select or edit your existing key vault or create a new one. 请务必授予数据工厂托管标识对 Key Vault 的访问权限(如果尚未这样做)。Make sure to grant Data Factory managed identity access to your key vault if you haven't done so already. 此外,还可以采用以下格式直接输入机密:<key vault linked service name>/<secret name>/<secret version>You can also enter your secret directly in the following format: <key vault linked service name>/<secret name>/<secret version>.

    这些凭据还用于访问“执行包任务”中在同一项目中引用的子包。These credentials are also used to access your child packages in Execute Package Task that are referenced from the same project.

  3. 如果在通过 SSDT 创建包时使用了 EncryptAllWithPasswordEncryptSensitiveWithPassword 保护级别,请在“加密密码”框中输入密码的值。If you used the EncryptAllWithPassword or EncryptSensitiveWithPassword protection level when you created your package via SSDT, enter the value for your password in the Encryption password box. 另外,还可以将 Azure Key Vault 中存储的机密用作其值(参阅上文)。Alternatively, you can use a secret stored in your Azure Key Vault as its value (see above).

    如果使用了 EncryptSensitiveWithUserKey 保护级别,请在“SSIS 参数”、“连接管理器”或“属性替代”选项卡上重新输入敏感值(参阅下文)。 If you used the EncryptSensitiveWithUserKey protection level, reenter your sensitive values on the SSIS Parameters, Connection Managers, or Property Overrides tabs (see below).

    不支持使用 EncryptAllWithUserKey 保护级别。If you used the EncryptAllWithUserKey protection level, it's unsupported. 需要通过 SSDT 或 dtutil 命令行实用程序将包重新配置为使用另一保护级别。You need to reconfigure your package to use another protection level via SSDT or the dtutil command-line utility.

  4. 对于“日志记录级别”,请为包执行选择预定义的日志记录范围。For Logging level, select a predefined scope of logging for your package execution. 如果要改为输入自定义日志记录名称,请选中“自定义”复选框。Select the Customized check box if you want to enter your customized logging name instead.

  5. 若要记录包执行但不使用可在包中指定的标准日志提供程序,请通过在“日志记录路径”框中提供其 UNC 路径来指定日志文件夹。If you want to log your package executions beyond using the standard log providers that can be specified in your package, specify your log folder by providing its UNC path in the Logging path box. 你可以通过选择“浏览文件存储”来浏览并选择日志文件夹,也可以手动输入其路径。You can browse and select your log folder by selecting Browse file storage or enter its path manually. 例如,如果将日志存储在 Azure 文件存储中,则日志记录路径为 \\<storage account name>.file.core.windows.net\<file share name>\<log folder name>For example, if you store your logs in Azure Files, your logging path is \\<storage account name>.file.core.windows.net\<file share name>\<log folder name>. 将在此路径中为每个包运行创建一个与“执行 SSIS 包”活动运行 ID 同名的子文件夹,每隔 5 分钟在其中生成一次日志文件。A subfolder is created in this path for each individual package run, named after the Execute SSIS Package activity run ID, and in which log files are generated every five minutes.

  6. 指定用于访问日志文件夹的凭据。Specify the credentials to access your log folder. 如果先前已输入包访问凭据的值(参阅上文),则可以通过选中“与包访问凭据相同”复选框来重复使用这些值。If you previously entered the values for your package access credentials (see above), you can reuse them by selecting the Same as package access credentials check box. 否则,请在“域”、“用户名”和“密码”框中输入日志记录访问凭据的值。 Otherwise, enter the values for your logging access credentials in the Domain, Username, and Password boxes. 例如,如果将日志存储在 Azure 文件存储中,则域为 Azure,用户名为 <storage account name>,密码为 <storage account key>For example, if you store your logs in Azure Files, the domain is Azure, the username is <storage account name>, and the password is <storage account key>. 另外,还可以将 Azure Key Vault 中存储的机密用作其值(参阅上文)。Alternatively, you can use secrets stored in your Azure Key Vault as their values (see above).

对于上述所有 UNC 路径,完全限定的文件名必须短于 260 个字符。For all UNC paths previously mentioned, the fully qualified file name must be fewer than 260 characters. 目录名称必须短于 248 个字符。The directory name must be fewer than 248 characters.

包位置:嵌入包Package location: Embedded package

如果选择“嵌入包”作为包位置,请完成以下步骤。If you select Embedded package as your package location, complete the following steps.

在“设置”选项卡上设置属性 - 嵌入包

  1. 通过拖放你的包来运行包,或将其从文件夹“上传”到提供的框中。Drag and drop your package to run or Upload it from a file folder into the box provided. 包会自动压缩并嵌入到活动有效负载中。Your package will be automatically compressed and embedded in the activity payload. 嵌入后,可以“下载”包供以后编辑。Once embedded, you can Download your package later for editing. 你还可以通过将嵌入包分配给可在多个活动中使用的管道参数来参数化它,从而优化管道有效负载的大小。You can also Parameterize your embedded package by assigning it to a pipeline parameter that can be used in multiple activities, hence optimizing the size of your pipeline payload.

  2. 如果嵌入包不是全部加密的,并且我们检测到其中使用了“执行包任务”,则系统会自动选择“执行包任务”复选框,并自动添加相关子包及其文件系统引用,以便你也嵌入它们。If your embedded package is not all encrypted and we detect the use of Execute Package Task in it, the Execute Package Task check box will be automatically selected and the relevant child packages with their file system references will be automatically added for you to also embed them.

    如果无法检测到“执行包任务”的使用,则必须手动选中“执行包任务”复选框,并添加相关子包,其文件系统会逐个引用它们,这样你就也可以嵌入它们。If we can't detect the use of Execute Package Task, you'll have to manually select the Execute Package Task check box and add the relevant child packages with their file system references one by one for you to also embed them. 如果子包使用 SQL Server 引用,请确保 Azure-SSIS IR 可以访问 SQL Server。If the child packages use SQL Server references, please ensure that the SQL Server is accessible by your Azure-SSIS IR. 当前不支持为子包使用项目引用。The use of project references for child packages is currently unsupported.

  3. 如果在通过 SSDT 创建包时使用了 EncryptAllWithPasswordEncryptSensitiveWithPassword 保护级别,请在“加密密码”框中输入密码的值。If you used the EncryptAllWithPassword or EncryptSensitiveWithPassword protection level when you created your package via SSDT, enter the value for your password in the Encryption password box.

    另外,还可以将 Azure Key Vault 中存储的机密用作其值。Alternatively, you can use a secret stored in your Azure Key Vault as its value. 为此,请选中其旁边的“AZURE KEY VAULT”复选框。To do so, select the AZURE KEY VAULT check box next to it. 选择或编辑现有的 Key Vault 链接服务,或创建新的链接服务。Select or edit your existing key vault linked service or create a new one. 然后,针对你的值选择机密名称和版本。Then select the secret name and version for your value. 创建或编辑 Key Vault 链接服务时,可以选择或编辑现有的 Key Vault,或创建新的 Key Vault。When you create or edit your key vault linked service, you can select or edit your existing key vault or create a new one. 请务必授予数据工厂托管标识对 Key Vault 的访问权限(如果尚未这样做)。Make sure to grant Data Factory managed identity access to your key vault if you haven't done so already. 此外,还可以采用以下格式直接输入机密:<key vault linked service name>/<secret name>/<secret version>You can also enter your secret directly in the following format: <key vault linked service name>/<secret name>/<secret version>.

    如果使用了 EncryptSensitiveWithUserKey 保护级别,请在配置文件中或在“SSIS 参数”、“连接管理器”或“属性替代”选项卡上重新输入敏感值(参阅下文)。 If you used the EncryptSensitiveWithUserKey protection level, reenter your sensitive values in configuration files or on the SSIS Parameters, Connection Managers, or Property Overrides tabs (see below).

    不支持使用 EncryptAllWithUserKey 保护级别。If you used the EncryptAllWithUserKey protection level, it's unsupported. 需要通过 SSDT 或 dtutil 命令行实用程序将包重新配置为使用另一保护级别。You need to reconfigure your package to use another protection level via SSDT or the dtutil command-line utility.

  4. 对于“日志记录级别”,请为包执行选择预定义的日志记录范围。For Logging level, select a predefined scope of logging for your package execution. 如果要改为输入自定义日志记录名称,请选中“自定义”复选框。Select the Customized check box if you want to enter your customized logging name instead.

  5. 若要记录包执行但不使用可在包中指定的标准日志提供程序,请通过在“日志记录路径”框中提供其 UNC 路径来指定日志文件夹。If you want to log your package executions beyond using the standard log providers that can be specified in your package, specify your log folder by providing its UNC path in the Logging path box. 你可以通过选择“浏览文件存储”来浏览并选择日志文件夹,也可以手动输入其路径。You can browse and select your log folder by selecting Browse file storage or enter its path manually. 例如,如果将日志存储在 Azure 文件存储中,则日志记录路径为 \\<storage account name>.file.core.windows.net\<file share name>\<log folder name>For example, if you store your logs in Azure Files, your logging path is \\<storage account name>.file.core.windows.net\<file share name>\<log folder name>. 将在此路径中为每个包运行创建一个与“执行 SSIS 包”活动运行 ID 同名的子文件夹,每隔 5 分钟在其中生成一次日志文件。A subfolder is created in this path for each individual package run, named after the Execute SSIS Package activity run ID, and in which log files are generated every five minutes.

  6. 通过在“域”、“用户名”和“密码”框中输入值来指定用于访问日志文件夹的凭据。Specify the credentials to access your log folder by entering their values in the Domain, Username, and Password boxes. 例如,如果将日志存储在 Azure 文件存储中,则域为 Azure,用户名为 <storage account name>,密码为 <storage account key>For example, if you store your logs in Azure Files, the domain is Azure, the username is <storage account name>, and the password is <storage account key>. 另外,还可以将 Azure Key Vault 中存储的机密用作其值(参阅上文)。Alternatively, you can use secrets stored in your Azure Key Vault as their values (see above).

对于上述所有 UNC 路径,完全限定的文件名必须短于 260 个字符。For all UNC paths previously mentioned, the fully qualified file name must be fewer than 260 characters. 目录名称必须短于 248 个字符。The directory name must be fewer than 248 characters.

包位置:包存储Package location: Package store

如果选择“包存储”作为包位置,请完成以下步骤。If you select Package store as your package location, complete the following steps.

在“设置”选项卡上设置属性 - 包存储

  1. 对于“包存储名称”,请选择附加到你的 Azure-SSIS IR 的一个现有包存储。For Package store name, select an existing package store that's attached to your Azure-SSIS IR.

  2. 通过在“包路径”框中提供你的包在所选包存储中的路径(不带 .dtsx 扩展名),指定要运行的包。Specify your package to run by providing its path (without .dtsx) from the selected package store in the Package path box. 如果所选包存储位于文件系统/Azure 文件存储上,则可以通过选择“浏览文件存储”来浏览并选择包,否则,可以采用 <folder name>\<package name> 格式输入其路径。If the selected package store is on top of file system/Azure Files, you can browse and select your package by selecting Browse file storage, otherwise you can enter its path in the format of <folder name>\<package name>. 还可以通过 SQL Server Management Studio (SSMS) 将新包导入到所选的包存储中,这与旧版 SSIS 包存储类似。You can also import new packages into the selected package store via SQL Server Management Studio (SSMS) similar to the legacy SSIS package store. 有关详细信息,请参阅使用 Azure-SSIS IR 包存储管理 SSIS 包For more information, see Manage SSIS packages with Azure-SSIS IR package stores.

  3. 如果在单独的文件中配置包,则需要在“配置路径”框中提供配置文件(带扩展名 .dtsConfig)的 UNC 路径。If you configure your package in a separate file, you need to provide a UNC path to your configuration file (with .dtsConfig) in the Configuration path box. 你可以通过选择“浏览文件存储”来浏览并选择配置,也可以手动输入其路径。You can browse and select your configuration by selecting Browse file storage or enter its path manually. 例如,如果将配置存储在 Azure 文件存储中,则其路径为 \\<storage account name>.file.core.windows.net\<file share name>\<configuration name>.dtsConfigFor example, if you store your configuration in Azure Files, its path is \\<storage account name>.file.core.windows.net\<file share name>\<configuration name>.dtsConfig.

  4. 选中“配置访问凭据”复选框,以选择是否要单独指定用于访问配置文件的凭据。Select the Configuration access credentials check box to choose whether you want to specify the credentials to access your configuration file separately. 当所选的包存储位于由 Azure SQL 托管实例承载的 SQL Server 数据库 (MSDB) 上或未同时存储你的配置文件时,需要进行此配置。This is needed when the selected package store is on top of SQL Server database (MSDB) hosted by your Azure SQL Managed Instance or doesn't also store your configuration file.

    如果你先前已输入包执行凭据的值(对于 Windows 身份验证),则可以通过选中“与包执行凭据相同”复选框来重复使用这些值。If you previously entered the values for your package execution credentials (for Windows authentication), you can reuse them by selecting the Same as package execution credentials check box. 否则,请在“域”、“用户名”和“密码”框中输入配置访问凭据的值。 Otherwise, enter the values for your configuration access credentials in the Domain, Username, and Password boxes. 例如,如果你将配置存储在 Azure 文件存储中,则域为 Azure,用户名为 <storage account name>,密码为 <storage account key>For example, if you store your configuration in Azure Files, the domain is Azure, the username is <storage account name>, and the password is <storage account key>.

    另外,还可以将 Azure Key Vault 中存储的机密用作其值。Alternatively, you can use secrets stored in your Azure Key Vault as their values. 为此,请选中它们旁边的“AZURE KEY VAULT”复选框。To do so, select the AZURE KEY VAULT check box next to them. 选择或编辑现有的 Key Vault 链接服务,或创建新的链接服务。Select or edit your existing key vault linked service or create a new one. 然后,针对你的值选择机密名称和版本。Then select the secret name and version for your value. 创建或编辑 Key Vault 链接服务时,可以选择或编辑现有的 Key Vault,或创建新的 Key Vault。When you create or edit your key vault linked service, you can select or edit your existing key vault or create a new one. 请务必授予数据工厂托管标识对 Key Vault 的访问权限(如果尚未这样做)。Make sure to grant Data Factory managed identity access to your key vault if you haven't done so already. 此外,还可以采用以下格式直接输入机密:<key vault linked service name>/<secret name>/<secret version>You can also enter your secret directly in the following format: <key vault linked service name>/<secret name>/<secret version>.

  5. 如果在通过 SSDT 创建包时使用了 EncryptAllWithPasswordEncryptSensitiveWithPassword 保护级别,请在“加密密码”框中输入密码的值。If you used the EncryptAllWithPassword or EncryptSensitiveWithPassword protection level when you created your package via SSDT, enter the value for your password in the Encryption password box. 另外,还可以将 Azure Key Vault 中存储的机密用作其值(参阅上文)。Alternatively, you can use a secret stored in your Azure Key Vault as its value (see above).

    如果使用了 EncryptSensitiveWithUserKey 保护级别,请在配置文件中或在“SSIS 参数”、“连接管理器”或“属性替代”选项卡上重新输入敏感值(参阅下文)。 If you used the EncryptSensitiveWithUserKey protection level, reenter your sensitive values in configuration files or on the SSIS Parameters, Connection Managers, or Property Overrides tabs (see below).

    不支持使用 EncryptAllWithUserKey 保护级别。If you used the EncryptAllWithUserKey protection level, it's unsupported. 需要通过 SSDT 或 dtutil 命令行实用程序将包重新配置为使用另一保护级别。You need to reconfigure your package to use another protection level via SSDT or the dtutil command-line utility.

  6. 对于“日志记录级别”,请为包执行选择预定义的日志记录范围。For Logging level, select a predefined scope of logging for your package execution. 如果要改为输入自定义日志记录名称,请选中“自定义”复选框。Select the Customized check box if you want to enter your customized logging name instead.

  7. 若要记录包执行但不使用可在包中指定的标准日志提供程序,请通过在“日志记录路径”框中提供其 UNC 路径来指定日志文件夹。If you want to log your package executions beyond using the standard log providers that can be specified in your package, specify your log folder by providing its UNC path in the Logging path box. 你可以通过选择“浏览文件存储”来浏览并选择日志文件夹,也可以手动输入其路径。You can browse and select your log folder by selecting Browse file storage or enter its path manually. 例如,如果将日志存储在 Azure 文件存储中,则日志记录路径为 \\<storage account name>.file.core.windows.net\<file share name>\<log folder name>For example, if you store your logs in Azure Files, your logging path is \\<storage account name>.file.core.windows.net\<file share name>\<log folder name>. 将在此路径中为每个包运行创建一个与“执行 SSIS 包”活动运行 ID 同名的子文件夹,每隔 5 分钟在其中生成一次日志文件。A subfolder is created in this path for each individual package run, named after the Execute SSIS Package activity run ID, and in which log files are generated every five minutes.

  8. 通过在“域”、“用户名”和“密码”框中输入值来指定用于访问日志文件夹的凭据。Specify the credentials to access your log folder by entering their values in the Domain, Username, and Password boxes. 例如,如果将日志存储在 Azure 文件存储中,则域为 Azure,用户名为 <storage account name>,密码为 <storage account key>For example, if you store your logs in Azure Files, the domain is Azure, the username is <storage account name>, and the password is <storage account key>. 另外,还可以将 Azure Key Vault 中存储的机密用作其值(参阅上文)。Alternatively, you can use secrets stored in your Azure Key Vault as their values (see above).

对于上述所有 UNC 路径,完全限定的文件名必须短于 260 个字符。For all UNC paths previously mentioned, the fully qualified file name must be fewer than 260 characters. 目录名称必须短于 248 个字符。The directory name must be fewer than 248 characters.

“SSIS 参数”选项卡SSIS Parameters tab

在“执行 SSIS 包”活动的“SSIS 参数”选项卡上,完成以下步骤。On the SSIS Parameters tab of Execute SSIS Package activity, complete the following steps.

在“SSIS 参数”选项卡上设置属性

  1. 如果 Azure-SSIS IR 正在运行,而你已选择“SSISDB”作为包位置,并已清除“设置”选项卡上的“手动输入内容”复选框,则会显示 SSISDB 中选定项目和包中现有的 SSIS 参数,方便你为它们赋值 。If your Azure-SSIS IR is running, SSISDB is selected as your package location, and the Manual entries check box on the Settings tab is cleared, the existing SSIS parameters in your selected project and package from SSISDB are displayed for you to assign values to them. 否则,可以逐个输入以便手动为它们赋值。Otherwise, you can enter them one by one to assign values to them manually. 为了使包成功执行,请确保它们存在并已正确输入。Make sure that they exist and are correctly entered for your package execution to succeed.

  2. 如果通过 SSDT 创建包时使用了 EncryptSensitiveWithUserKey 保护级别,并且选择了“文件系统(包)”、“文件系统(项目)”、“嵌入包”或“包存储”作为包位置,则还需要重新输入敏感参数,以便在此选项卡上为它们赋值。 If you used the EncryptSensitiveWithUserKey protection level when you created your package via SSDT and File System (Package), File System (Project), Embedded package, or Package store is selected as your package location, you also need to reenter your sensitive parameters to assign values to them on this tab.

为参数赋值时,可以使用表达式、函数、数据工厂系统变量和数据工厂管道参数或变量添加动态内容。When you assign values to your parameters, you can add dynamic content by using expressions, functions, Data Factory system variables, and Data Factory pipeline parameters or variables.

另外,还可以将 Azure Key Vault 中存储的机密用作其值。Alternatively, you can use secrets stored in your Azure Key Vault as their values. 为此,请选中它们旁边的“AZURE KEY VAULT”复选框。To do so, select the AZURE KEY VAULT check box next to them. 选择或编辑现有的 Key Vault 链接服务,或创建新的链接服务。Select or edit your existing key vault linked service or create a new one. 然后,针对你的值选择机密名称和版本。Then select the secret name and version for your value. 创建或编辑 Key Vault 链接服务时,可以选择或编辑现有的 Key Vault,或创建新的 Key Vault。When you create or edit your key vault linked service, you can select or edit your existing key vault or create a new one. 请务必授予数据工厂托管标识对 Key Vault 的访问权限(如果尚未这样做)。Make sure to grant Data Factory managed identity access to your key vault if you haven't done so already. 此外,还可以采用以下格式直接输入机密:<key vault linked service name>/<secret name>/<secret version>You can also enter your secret directly in the following format: <key vault linked service name>/<secret name>/<secret version>.

“连接管理器”选项卡Connection Managers tab

在“执行 SSIS 包”活动的“连接管理器”选项卡上,完成以下步骤。On the Connection Managers tab of Execute SSIS Package activity, complete the following steps.

在“连接管理器”选项卡上设置属性

  1. 如果 Azure-SSIS IR 正在运行,而你已选择“SSISDB”作为包位置,并已清除“设置”选项卡上的“手动输入内容”复选框,则会显示 SSISDB 中选定项目和包中现有的连接管理器,方便你为它们的属性赋值 。If your Azure-SSIS IR is running, SSISDB is selected as your package location, and the Manual entries check box on the Settings tab is cleared, the existing connection managers in your selected project and package from SSISDB are displayed for you to assign values to their properties. 否则,可以逐个输入以便手动为其属性赋值。Otherwise, you can enter them one by one to assign values to their properties manually. 为了使包成功执行,请确保它们存在并已正确输入。Make sure that they exist and are correctly entered for your package execution to succeed.

  2. 如果通过 SSDT 创建包时使用了 EncryptSensitiveWithUserKey 保护级别,并且选择了“文件系统(包)”、“文件系统(项目)”、“嵌入包”或“包存储”作为包位置,则还需要重新输入敏感的连接管理器属性,以便在此选项卡上为它们赋值。 If you used the EncryptSensitiveWithUserKey protection level when you created your package via SSDT and File System (Package), File System (Project), Embedded package, or Package store is selected as your package location, you also need to reenter your sensitive connection manager properties to assign values to them on this tab.

为连接管理器属性赋值时,可以使用表达式、函数、数据工厂系统变量和数据工厂管道参数或变量添加动态内容。When you assign values to your connection manager properties, you can add dynamic content by using expressions, functions, Data Factory system variables, and Data Factory pipeline parameters or variables.

另外,还可以将 Azure Key Vault 中存储的机密用作其值。Alternatively, you can use secrets stored in your Azure Key Vault as their values. 为此,请选中它们旁边的“AZURE KEY VAULT”复选框。To do so, select the AZURE KEY VAULT check box next to them. 选择或编辑现有的 Key Vault 链接服务,或创建新的链接服务。Select or edit your existing key vault linked service or create a new one. 然后,针对你的值选择机密名称和版本。Then select the secret name and version for your value. 创建或编辑 Key Vault 链接服务时,可以选择或编辑现有的 Key Vault,或创建新的 Key Vault。When you create or edit your key vault linked service, you can select or edit your existing key vault or create a new one. 请务必授予数据工厂托管标识对 Key Vault 的访问权限(如果尚未这样做)。Make sure to grant Data Factory managed identity access to your key vault if you haven't done so already. 此外,还可以采用以下格式直接输入机密:<key vault linked service name>/<secret name>/<secret version>You can also enter your secret directly in the following format: <key vault linked service name>/<secret name>/<secret version>.

“属性替代”选项卡Property Overrides tab

在“执行 SSIS 包”活动的“属性替代”选项卡上,完成以下步骤。On the Property Overrides tab of Execute SSIS Package activity, complete the following steps.

在“属性替代”选项卡上设置属性

  1. 逐个输入选定包的现有属性的路径,以便手动为其赋值。Enter the paths of existing properties in your selected package one by one to assign values to them manually. 为了使包成功执行,请确保它们存在并已正确输入。Make sure that they exist and are correctly entered for your package execution to succeed. 例如,若要替代用户变量的值,请按以下格式输入其路径:\Package.Variables[User::<variable name>].ValueFor example, to override the value of your user variable, enter its path in the following format: \Package.Variables[User::<variable name>].Value.

  2. 如果通过 SSDT 创建包时使用了 EncryptSensitiveWithUserKey 保护级别,并且选择了“文件系统(包)”、“文件系统(项目)”、“嵌入包”或“包存储”作为包位置,则还需要重新输入敏感的包属性,以便在此选项卡上为它们赋值。 If you used the EncryptSensitiveWithUserKey protection level when you created your package via SSDT and File System (Package), File System (Project), Embedded package, or Package store is selected as your package location, you also need to reenter your sensitive package properties to assign values to them on this tab.

为包属性赋值时,可以使用表达式、函数、数据工厂系统变量和数据工厂管道参数或变量添加动态内容。When you assign values to your package properties, you can add dynamic content by using expressions, functions, Data Factory system variables, and Data Factory pipeline parameters or variables.

可以使用“连接管理器”或“属性替代”选项卡替代配置文件中和“SSIS 参数”选项卡上的赋值。 The values assigned in configuration files and on the SSIS Parameters tab can be overridden by using the Connection Managers or Property Overrides tabs. 还可以使用“属性替代”选项卡替代“连接管理器”选项卡上的赋值。 The values assigned on the Connection Managers tab can also be overridden by using the Property Overrides tab.

若要验证管道配置,请在工具栏中选择“验证”。To validate the pipeline configuration, select Validate on the toolbar. 若要关闭“管道验证报告”,请选择 >>To close the Pipeline Validation Report, select >>.

若要将管道发布到数据工厂,请选择“全部发布”。To publish the pipeline to Data Factory, select Publish All.

运行管道Run the pipeline

在此步骤中,将触发管道运行。In this step, you trigger a pipeline run.

  1. 若要触发某个管道运行,请在工具栏中选择“触发器”,然后选择“立即触发”。To trigger a pipeline run, select Trigger on the toolbar, and select Trigger now.

    立即触发

  2. 在“管道运行”窗口中选择“完成”。 In the Pipeline Run window, select Finish.

监视管道Monitor the pipeline

  1. 在左侧切换到“监视”选项卡。Switch to the Monitor tab on the left. 随即显示管道运行及其状态和其他信息(例如“运行开始”时间)。You see the pipeline run and its status along with other information, such as the Run Start time. 若要刷新视图,请选择“刷新”。To refresh the view, select Refresh.

    管道运行

  2. 在“操作”列中选择“查看活动运行”链接。 Select the View Activity Runs link in the Actions column. 此时只显示一个活动运行,因为管道只有一个活动。You see only one activity run because the pipeline has only one activity. 该活动为“执行 SSIS 包”活动。It's the Execute SSIS Package activity.

    活动运行

  3. 在 SQL Server 中针对 SSISDB 数据库运行以下查询,验证是否执行了该包。Run the following query against the SSISDB database in your SQL server to verify that the package executed.

    select * from catalog.executions
    

    验证包执行

  4. 还可以从管道活动运行的输出中获取 SSISDB 执行 ID,并使用此 ID 在 SQL Server Management Studio 中查看更全面的执行日志和错误消息。You can also get the SSISDB execution ID from the output of the pipeline activity run and use the ID to check more comprehensive execution logs and error messages in SQL Server Management Studio.

    获取执行 ID。

使用触发器计划管道Schedule the pipeline with a trigger

还可以为管道创建一个计划触发器,以便按计划(例如每小时或每天)运行管道。You can also create a scheduled trigger for your pipeline so that the pipeline runs on a schedule, such as hourly or daily. 有关示例,请参阅创建数据工厂 - 数据工厂 UIFor an example, see Create a data factory - Data Factory UI.

使用 PowerShell 运行包Run a package with PowerShell

在此部分中,将使用 Azure PowerShell 创建一个数据工厂管道,管道中包含可运行 SSIS 包的“执行 SSIS 包”活动。In this section, you use Azure PowerShell to create a Data Factory pipeline with an Execute SSIS Package activity that runs your SSIS package.

按照如何安装和配置 Azure PowerShell 中的分步说明安装最新的 Azure PowerShell 模块。Install the latest Azure PowerShell modules by following the step-by-step instructions in How to install and configure Azure PowerShell.

创建包含 Azure-SSIS IR 的数据工厂Create a data factory with Azure-SSIS IR

可以使用已预配 Azure-SSIS IR 的现有数据工厂,或者创建包含 Azure-SSIS IR 的新数据工厂。You can either use an existing data factory that already has Azure-SSIS IR provisioned or create a new data factory with Azure-SSIS IR. 按照教程:通过 PowerShell 将 SSIS 包部署到 Azure 中的分步说明,创建包含 Azure-SSIS IR 的新 ADF。Follow the step-by-step instructions in the Tutorial: Deploy SSIS packages to Azure via PowerShell.

使用“执行 SSIS 包”活动创建管道Create a pipeline with an Execute SSIS Package activity

在此步骤中创建包含“执行 SSIS 包”活动的管道。In this step, you create a pipeline with an Execute SSIS Package activity. 该活动运行 SSIS 包。The activity runs your SSIS package.

  1. C:\ADF\RunSSISPackage 文件夹中创建一个名为 RunSSISPackagePipeline.json 的 JSON 文件,使其包含类似于以下示例的内容。Create a JSON file named RunSSISPackagePipeline.json in the C:\ADF\RunSSISPackage folder with content similar to the following example.

    重要

    在保存该文件之前,请替换对象名称、说明、路径、属性或参数值、密码及其他变量值。Replace object names, descriptions, and paths, property or parameter values, passwords, and other variable values before you save the file.

    {
        "name": "RunSSISPackagePipeline",
        "properties": {
            "activities": [{
                "name": "MySSISActivity",
                "description": "My SSIS package/activity description",
                "type": "ExecuteSSISPackage",
                "typeProperties": {
                    "connectVia": {
                        "referenceName": "MyAzureSSISIR",
                        "type": "IntegrationRuntimeReference"
                    },
                    "executionCredential": {
                        "domain": "MyExecutionDomain",
                        "username": "MyExecutionUsername",
                        "password": {
                            "type": "SecureString",
                            "value": "MyExecutionPassword"
                        }
                    },
                    "runtime": "x64",
                    "loggingLevel": "Basic",
                    "packageLocation": {
                        "type": "SSISDB",
                        "packagePath": "MyFolder/MyProject/MyPackage.dtsx"
                    },
                    "environmentPath": "MyFolder/MyEnvironment",
                    "projectParameters": {
                        "project_param_1": {
                            "value": "123"
                        },
                        "project_param_2": {
                            "value": {
                                "value": "@pipeline().parameters.MyProjectParameter",
                                "type": "Expression"
                            }
                        }
                    },
                    "packageParameters": {
                        "package_param_1": {
                            "value": "345"
                        },
                        "package_param_2": {
                            "value": {
                                "type": "AzureKeyVaultSecret",
                                "store": {
                                    "referenceName": "myAKV",
                                    "type": "LinkedServiceReference"
                                },
                                "secretName": "MyPackageParameter"
                            }
                        }
                    },
                    "projectConnectionManagers": {
                        "MyAdonetCM": {
                            "username": {
                                "value": "MyConnectionUsername"
                            },
                            "password": {
                                "value": {
                                    "type": "SecureString",
                                    "value": "MyConnectionPassword"
                                }
                            }
                        }
                    },
                    "packageConnectionManagers": {
                        "MyOledbCM": {
                            "username": {
                                "value": {
                                    "value": "@pipeline().parameters.MyConnectionUsername",
                                    "type": "Expression"
                                }
                            },
                            "password": {
                                "value": {
                                    "type": "AzureKeyVaultSecret",
                                    "store": {
                                        "referenceName": "myAKV",
                                        "type": "LinkedServiceReference"
                                    },
                                    "secretName": "MyConnectionPassword",
                                    "secretVersion": "MyConnectionPasswordVersion"
                                }
                            }
                        }
                    },
                    "propertyOverrides": {
                        "\\Package.MaxConcurrentExecutables": {
                            "value": 8,
                            "isSensitive": false
                        }
                    }
                },
                "policy": {
                    "timeout": "0.01:00:00",
                    "retry": 0,
                    "retryIntervalInSeconds": 30
                }
            }]
        }
    }
    

    若要执行存储在文件系统/Azure 文件存储中的包,请输入包和日志位置属性的值,如下所示:To execute packages stored in file system/Azure Files, enter the values for your package and log location properties as follows:

    {
        {
            {
                {
                    "packageLocation": {
                        "type": "File",
                        "packagePath": "//MyStorageAccount.file.core.windows.net/MyFileShare/MyPackage.dtsx",
                        "typeProperties": {
                            "packagePassword": {
                                "type": "SecureString",
                                "value": "MyEncryptionPassword"
                            },
                            "accessCredential": {
                                "domain": "Azure",
                                "username": "MyStorageAccount",
                                "password": {
                                    "type": "SecureString",
                                    "value": "MyAccountKey"
                                }
                            }
                        }
                    },
                    "logLocation": {
                        "type": "File",
                        "logPath": "//MyStorageAccount.file.core.windows.net/MyFileShare/MyLogFolder",
                        "typeProperties": {
                            "accessCredential": {
                                "domain": "Azure",
                                "username": "MyStorageAccount",
                                "password": {
                                    "type": "AzureKeyVaultSecret",
                                    "store": {
                                        "referenceName": "myAKV",
                                        "type": "LinkedServiceReference"
                                    },
                                    "secretName": "MyAccountKey"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    

    若要执行存储在文件系统/Azure 文件存储中的项目内的包,请输入包位置属性的值,如下所示:To execute packages within projects stored in file system/Azure Files, enter the values for your package location properties as follows:

    {
        {
            {
                {
                    "packageLocation": {
                        "type": "File",
                        "packagePath": "//MyStorageAccount.file.core.windows.net/MyFileShare/MyProject.ispac:MyPackage.dtsx",
                        "typeProperties": {
                            "packagePassword": {
                                "type": "SecureString",
                                "value": "MyEncryptionPassword"
                            },
                            "accessCredential": {
                                "domain": "Azure",
                                "userName": "MyStorageAccount",
                                "password": {
                                    "type": "SecureString",
                                    "value": "MyAccountKey"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    

    若要执行嵌入包,请输入包位置属性的值,如下所示:To execute embedded packages, enter the values for your package location properties as follows:

    {
        {
            {
                {
                    "packageLocation": {
                        "type": "InlinePackage",
                        "typeProperties": {
                            "packagePassword": {
                                "type": "SecureString",
                                "value": "MyEncryptionPassword"
                            },
                            "packageName": "MyPackage.dtsx",
                            "packageContent":"My compressed/uncompressed package content",
                            "packageLastModifiedDate": "YYYY-MM-DDTHH:MM:SSZ UTC-/+HH:MM"
                        }
                    }
                }
            }
        }
    }
    

    若要执行存储在包存储中的包,请输入包和配置位置属性的值,如下所示:To execute packages stored in package stores, enter the values for your package and configuration location properties as follows:

    {
        {
            {
                {
                    "packageLocation": {
                        "type": "PackageStore",
                        "packagePath": "myPackageStore/MyFolder/MyPackage",
                        "typeProperties": {
                            "packagePassword": {
                                "type": "SecureString",
                                "value": "MyEncryptionPassword"
                            },
                            "accessCredential": {
                                "domain": "Azure",
                                "username": "MyStorageAccount",
                                "password": {
                                    "type": "SecureString",
                                    "value": "MyAccountKey"
                                }
                            },
                            "configurationPath": "//MyStorageAccount.file.core.windows.net/MyFileShare/MyConfiguration.dtsConfig",
                            "configurationAccessCredential": {
                                "domain": "Azure",
                                "userName": "MyStorageAccount",
                                "password": {
                                    "type": "AzureKeyVaultSecret",
                                    "store": {
                                        "referenceName": "myAKV",
                                        "type": "LinkedServiceReference"
                                    },
                                    "secretName": "MyAccountKey"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    
  2. 在 Azure PowerShell 中,切换到 C:\ADF\RunSSISPackage 文件夹。In Azure PowerShell, switch to the C:\ADF\RunSSISPackage folder.

  3. 若要创建管道 RunSSISPackagePipeline,请运行 Set-AzDataFactoryV2Pipeline cmdlet。To create the pipeline RunSSISPackagePipeline, run the Set-AzDataFactoryV2Pipeline cmdlet.

    $DFPipeLine = Set-AzDataFactoryV2Pipeline -DataFactoryName $DataFactory.DataFactoryName `
                                                   -ResourceGroupName $ResGrp.ResourceGroupName `
                                                   -Name "RunSSISPackagePipeline"
                                                   -DefinitionFile ".\RunSSISPackagePipeline.json"
    

    下面是示例输出:Here's the sample output:

    PipelineName      : Adfv2QuickStartPipeline
    ResourceGroupName : <resourceGroupName>
    DataFactoryName   : <dataFactoryName>
    Activities        : {CopyFromBlobToBlob}
    Parameters        : {[inputPath, Microsoft.Azure.Management.DataFactory.Models.ParameterSpecification], [outputPath, Microsoft.Azure.Management.DataFactory.Models.ParameterSpecification]}
    

运行管道Run the pipeline

使用 Invoke-AzDataFactoryV2Pipeline cmdlet 运行该管道。Use the Invoke-AzDataFactoryV2Pipeline cmdlet to run the pipeline. 此 cmdlet 返回管道运行 ID,用于将来的监视。The cmdlet returns the pipeline run ID for future monitoring.

$RunId = Invoke-AzDataFactoryV2Pipeline -DataFactoryName $DataFactory.DataFactoryName `
                                             -ResourceGroupName $ResGrp.ResourceGroupName `
                                             -PipelineName $DFPipeLine.Name

监视管道Monitor the pipeline

运行以下 PowerShell 脚本,持续检查管道运行状态,直到完成数据复制为止。Run the following PowerShell script to continuously check the pipeline run status until it finishes copying the data. 在 PowerShell 窗口中复制或粘贴以下脚本,然后按 Enter。Copy or paste the following script in the PowerShell window, and select Enter.

while ($True) {
    $Run = Get-AzDataFactoryV2PipelineRun -ResourceGroupName $ResGrp.ResourceGroupName `
                                               -DataFactoryName $DataFactory.DataFactoryName `
                                               -PipelineRunId $RunId

    if ($Run) {
        if ($run.Status -ne 'InProgress') {
            Write-Output ("Pipeline run finished. The status is: " +  $Run.Status)
            $Run
            break
        }
        Write-Output  "Pipeline is running...status: InProgress"
    }

    Start-Sleep -Seconds 10
}   

还可使用 Azure 门户监视管道。You can also monitor the pipeline by using the Azure portal. 有关分步说明,请参阅监视管道For step-by-step instructions, see Monitor the pipeline.

使用触发器计划管道Schedule the pipeline with a trigger

在上一步骤中,已按需运行了管道。In the previous step, you ran the pipeline on demand. 还可创建一个计划触发器,按计划(例如每小时或每天)运行管道。You can also create a schedule trigger to run the pipeline on a schedule, such as hourly or daily.

  1. C:\ADF\RunSSISPackage 文件夹中创建一个名为 MyTrigger.json 的 JSON 文件,使其包含以下内容:Create a JSON file named MyTrigger.json in the C:\ADF\RunSSISPackage folder with the following content:

    {
        "properties": {
            "name": "MyTrigger",
            "type": "ScheduleTrigger",
            "typeProperties": {
                "recurrence": {
                    "frequency": "Hour",
                    "interval": 1,
                    "startTime": "2017-12-07T00:00:00-08:00",
                    "endTime": "2017-12-08T00:00:00-08:00"
                }
            },
            "pipelines": [{
                "pipelineReference": {
                    "type": "PipelineReference",
                    "referenceName": "RunSSISPackagePipeline"
                },
                "parameters": {}
            }]
        }
    }    
    
  2. 在 Azure PowerShell 中,切换到 C:\ADF\RunSSISPackage 文件夹。In Azure PowerShell, switch to the C:\ADF\RunSSISPackage folder.

  3. 运行 Set-AzDataFactoryV2Trigger cmdlet,以创建触发器。Run the Set-AzDataFactoryV2Trigger cmdlet, which creates the trigger.

    Set-AzDataFactoryV2Trigger -ResourceGroupName $ResGrp.ResourceGroupName `
                                    -DataFactoryName $DataFactory.DataFactoryName `
                                    -Name "MyTrigger" -DefinitionFile ".\MyTrigger.json"
    
  4. 默认情况下,触发器处于停止状态。By default, the trigger is in stopped state. 运行 Start-AzDataFactoryV2Trigger cmdlet 以启动该触发器。Start the trigger by running the Start-AzDataFactoryV2Trigger cmdlet.

    Start-AzDataFactoryV2Trigger -ResourceGroupName $ResGrp.ResourceGroupName `
                                      -DataFactoryName $DataFactory.DataFactoryName `
                                      -Name "MyTrigger" 
    
  5. 通过运行 Get-AzDataFactoryV2Trigger cmdlet 确认该触发器已启动。Confirm that the trigger is started by running the Get-AzDataFactoryV2Trigger cmdlet.

    Get-AzDataFactoryV2Trigger -ResourceGroupName $ResourceGroupName `
                                    -DataFactoryName $DataFactoryName `
                                    -Name "MyTrigger"     
    
  6. 在下一小时后运行以下命令。Run the following command after the next hour. 例如,如果当前时间为下午 3:25 (UTC),则在下午 4:00 (UTC) 运行该命令。For example, if the current time is 3:25 PM UTC, run the command at 4 PM UTC.

    Get-AzDataFactoryV2TriggerRun -ResourceGroupName $ResourceGroupName `
                                       -DataFactoryName $DataFactoryName `
                                       -TriggerName "MyTrigger" `
                                       -TriggerRunStartedAfter "2017-12-06" `
                                       -TriggerRunStartedBefore "2017-12-09"
    

    在 SQL Server 中针对 SSISDB 数据库运行以下查询,验证是否执行了该包。Run the following query against the SSISDB database in your SQL server to verify that the package executed.

    select * from catalog.executions
    

后续步骤Next steps

请参阅以下博客文章:See the following blog post: