|
| 1 | +--- |
| 2 | +title: Execute SSIS packages by Azure SQL Managed Instance Agent |
| 3 | +description: Learn how to execute SSIS packages by Azure SQL Managed Instance Agent. |
| 4 | +services: data-factory |
| 5 | +documentationcenter: '' |
| 6 | +ms.service: data-factory |
| 7 | +ms.workload: data-services |
| 8 | +ms.topic: conceptual |
| 9 | +ms.author: lle |
| 10 | +author: lle |
| 11 | +ms.date: 04/14/2020 |
| 12 | +--- |
| 13 | + |
| 14 | +# Execute SSIS packages by Azure SQL Managed Instance Agent |
| 15 | +This article describes how to run a SQL Server Integration Services (SSIS) package by using Azure SQL Managed Instance Agent. This feature provides similar behaviors just like when you schedule SSIS packages by SQL Server Agent in your on-prem environment. |
| 16 | + |
| 17 | +With this feature, you can run SSIS packages that are stored in SSISDB of Azure SQL Managed Instance or File System such as Azure Files. |
| 18 | + |
| 19 | +## Prerequisites |
| 20 | +To use this feature, download and install the latest version of SSMS, which is version 18.5 or later. Download it from [this website](https://docs.microsoft.com/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-2017). |
| 21 | + |
| 22 | +And you need to provision an Azure-SSIS Integration Runtime in Azure Data Factory, which uses Azure SQL Managed Instance as endpoint server. If you have not provisioned it already, provision it by following instructions in the [tutorial](tutorial-create-azure-ssis-runtime-portal.md). |
| 23 | + |
| 24 | +## Run SSIS packages in SSISDB by Azure SQL Managed Instance Agent |
| 25 | +In this step, you use Azure SQL Managed Instance Agent to invoke SSIS packages that is stored in SSISDB in Azure SQL Managed Instance. |
| 26 | +1. In the latest version of SSMS, connect to Azure SQL Managed Instance. |
| 27 | +2. Create a new Agent Job and a new Job step. |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +3. In the **New Job Step** page, choose **SQL Server Integration Services Package** type. |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +4. In the **Package** tab, choose **SSIS Catalog** as package source type. |
| 36 | +5. Because the SSISDB is in the same Azure SQL Managed Instance, you don't need to specify authentication. |
| 37 | +6. Specify an SSIS package from your SSISDB. |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | +7. In the **Configurations** tab, you can specify **parameter** values, override values in **Connection Managers**, override **Property** and choose **Logging level**. |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +8. After you finished all configuration above, click **OK** to save the Agent Job configuration. |
| 46 | +9. Start the Agent Job to execute the SSIS package. |
| 47 | + |
| 48 | + |
| 49 | +## Run SSIS packages in file system by Azure SQL managed instance agent |
| 50 | +In this step, you use Azure SQL Managed Instance Agent to invoke SSIS packages that is stored in File System to run. |
| 51 | +1. In the latest version of SSMS, connect to Azure SQL Managed Instance. |
| 52 | +2. Create a new Agent Job and a new Job step. |
| 53 | + |
| 54 | +  |
| 55 | + |
| 56 | +3. In the **New Job Step** page, choose **SQL Server Integration Services Package** type. |
| 57 | + |
| 58 | +  |
| 59 | + |
| 60 | +4. In the **Package** tab, choose **File system** as package source type. |
| 61 | + |
| 62 | +  |
| 63 | + |
| 64 | + 1. If your package is uploaded to Azure File, choose **Azure file share** as file source type. |
| 65 | + - The package path is **\\<storage account name>.file.core.windows.net\<file share name>\<package name>.dtsx** |
| 66 | + - Type in the Azure file account name and account key in **Package file access credential** to access the Azure file. The domain is set as **Azure**. |
| 67 | + 2. If your package is uploaded to a network share, choose **Network share** as file source type. |
| 68 | + - The package path is the **UNC path** of your package file with its dtsx extension. |
| 69 | + - Type in corresponding **domain**, **username**, and **password** to access the network share package file. |
| 70 | + 3. If your package file is encrypted with password, select **Encryption password** and type in the password. |
| 71 | + |
| 72 | + 5. In the **Configurations** tab, type the **configuration file path** if your need a configuration file to execute the SSIS package. |
| 73 | + 6. In the **Execution options** tab, you can choose whether to use **windows authentication** or **32-bit runtime** to execute the SSIS package. |
| 74 | + 7. In the **Logging** tab, you can choose the **logging path** and corresponding logging access credential to store the log files. By default, the logging path will be the same as the package folder path and the logging access credential will be the same as the package access credential. |
| 75 | + 8. In the **Set values** tab, you can type in the **Property Path** and **Value** to override the package properties. |
| 76 | + For example, to override the value of your user variable, enter its path in the following format: **\Package.Variables[User::<variable name>].Value**. |
| 77 | + 9. After you finished all configuration above, click **OK** to save the Agent Job configuration. |
| 78 | + 10. Start the Agent Job to execute the SSIS package. |
| 79 | + |
| 80 | + |
| 81 | + ## Cancel SSIS package execution |
| 82 | + To cancel package execution from an Azure SQL Managed Agent job, you should follow below steps instead of directly stopping the agent job. |
| 83 | + 1. Find your SQL agent **jobId** from **msdb.dbo.sysjobs**. |
| 84 | + 2. Find corresponding SSIS **executionId** based on the job ID by below query: |
| 85 | + ```sql |
| 86 | + select * from ssisdb.internal.execution_parameter_values_noncatalog where parameter_value = 'SQL_Agent_Job_{jobId}' order by execution_id desc |
| 87 | + ``` |
| 88 | + 3. Select **Active Operations** under SSIS catalog. |
| 89 | + |
| 90 | +  |
| 91 | + |
| 92 | + 4. Stop corresponding operation based on **executionId**. |
| 93 | + |
| 94 | +## Next steps |
| 95 | + You can also schedule SSIS packages using Azure Data Factory. For step-by-step instructions, see [Azure Data Factory Event Trigger](how-to-create-event-trigger.md). |
0 commit comments