|
2 | 2 | title: "ADO.NET connection manager | Microsoft Docs" |
3 | 3 | description: An ADO.NET connection manager enables a package to access data sources by using a .NET provider. |
4 | 4 | ms.custom: "" |
5 | | -ms.date: "05/24/2019" |
| 5 | +ms.date: "07/19/2021" |
6 | 6 | ms.prod: sql |
7 | 7 | ms.prod_service: "integration-services" |
8 | 8 | ms.reviewer: "" |
@@ -79,62 +79,68 @@ Create an ADO.NET data connection by using the **Connection Manager** dialog box |
79 | 79 | Select a connection, and then delete it by selecting **Delete**. |
80 | 80 |
|
81 | 81 | #### Managed identities for Azure resources authentication |
82 | | -When running SSIS packages on [Azure-SSIS integration runtime in Azure Data Factory](/azure/data-factory/concepts-integration-runtime#azure-ssis-integration-runtime), you can use the [managed identity](/azure/data-factory/connector-azure-sql-database#managed-identity) associated with your data factory for Azure SQL Database or Azure SQL Managed Instance authentication. The designated factory can access and copy data from or to your database by using this identity. |
| 82 | +When running SSIS packages on [Azure-SSIS integration runtime (IR) in Azure Data Factory (ADF)](/azure/data-factory/concepts-integration-runtime.md#azure-ssis-integration-runtime), you can use Azure Active Directory (AAD) authentication with [the specified system/user-assigned managed identity for your ADF](/azure/data-factory/connector-azure-sql-database.md#managed-identity) to access Azure SQL Database server/Managed Instance. Your Azure-SSIS IR can access and copy data from or to your database by using this managed identity. |
83 | 83 |
|
84 | 84 | > [!NOTE] |
85 | | -> When you use Azure Active Directory (Azure AD) authentication (including managed identity authentication) to connect to Azure SQL Database or Azure SQL Managed Instance, you might encounter a problem related to package execution failure or unexpected behavior change. For more information, see [Azure AD features and limitations](/azure/sql-database/sql-database-aad-authentication#azure-ad-features-and-limitations). |
| 85 | +> When you use AAD authentication to access Azure SQL Database server/Managed Instance, you might encounter a problem related to package execution failure or unexpected behavior change. For more information, see [AAD features and limitations](/azure/sql-database/sql-database-aad-authentication.md#azure-ad-features-and-limitations). |
86 | 86 |
|
87 | | -To use managed identity authentication for Azure SQL Database, follow these steps to configure your database: |
| 87 | +To use AAD authentication with the specified system/user-assigned managed identity for your ADF to access Azure SQL Database server, follow these steps: |
88 | 88 |
|
89 | | -1. [Provision an Azure Active Directory administrator](/azure/sql-database/sql-database-aad-authentication-configure#provision-an-azure-active-directory-administrator-for-your-azure-sql-database-server) for your Azure SQL server on the Azure portal, if you haven't already done so. The Azure AD administrator can be an Azure AD user or Azure AD group. If you grant the group with managed identity an admin role, skip step 2 and 3. The administrator will have full access to the database. |
| 89 | +1. [Provision an AAD administrator](/azure/sql-database/sql-database-aad-authentication-configure.md#provision-an-azure-active-directory-administrator-for-your-azure-sql-database-server) for your Azure SQL Database server in Azure portal, if you haven't already done so. The AAD administrator can be an AAD user or group. If you grant the group with specified system/user-assigned managed identity for your ADF an admin role, skip step 2 - 3. The administrator will have full access to your Azure SQL Database server. |
90 | 90 |
|
91 | | -1. [Create contained database users](/azure/sql-database/sql-database-aad-authentication-configure#create-contained-database-users-in-your-database-mapped-to-azure-ad-identities) for the data factory managed identity. Connect to the database from or to which you want to copy data by using tools like SSMS, with an Azure AD identity that has at least ALTER ANY USER permission. Run the following T-SQL: |
92 | | - |
93 | | - ```sql |
94 | | - CREATE USER [your data factory name] FROM EXTERNAL PROVIDER; |
95 | | - ``` |
| 91 | +1. [Create a contained database user](/azure/sql-database/sql-database-aad-authentication-configure.md#create-contained-database-users-in-your-database-mapped-to-azure-ad-identities) to represent the specified system/user-assigned managed identity for your ADF. Connect to the database from or to which you want to copy data using SQL Server Management Studio (SSMS) with an AAD user that has at least ALTER ANY USER permission. Run the following T-SQL statement: |
| 92 | + |
| 93 | + ```sql |
| 94 | + CREATE USER [your managed identity name] FROM EXTERNAL PROVIDER; |
| 95 | + ``` |
| 96 | + |
| 97 | + If you use the system managed identity for your ADF, then *your managed identity name* should be your ADF name. If you use a user-assigned managed identity for your ADF, then *your managed identity name* should be the specified user-assigned managed identity name. |
96 | 98 |
|
97 | | -1. Grant the data factory managed identity needed permissions, as you normally do for SQL users and others. Refer to [Database-Level Roles](../../relational-databases/security/authentication-access/database-level-roles.md) for appropriate roles. Run the following code. For more options, see [this document](../../relational-databases/system-stored-procedures/sp-addrolemember-transact-sql.md). |
| 99 | +1. Grant the specified system/user-assigned managed identity for your ADF the required permissions, as you normally do for SQL users. Refer to [Database-level roles](../../relational-databases/security/authentication-access/database-level-roles.md) for appropriate roles. Run the following T-SQL statement. For more options, see [this article](../../relational-databases/system-stored-procedures/sp-addrolemember-transact-sql.md). |
98 | 100 |
|
99 | | - ```sql |
100 | | - EXEC sp_addrolemember [role name], [your data factory name]; |
101 | | - ``` |
| 101 | + ```sql |
| 102 | + EXEC sp_addrolemember [role name], [your managed identity name]; |
| 103 | + ``` |
102 | 104 |
|
103 | | -To use managed identity authentication for Azure SQL Managed Instance, follow these steps to configure your database: |
| 105 | +To use AAD authentication with the specified system/user-assigned managed identity for your ADF to access Azure SQL Managed Instance, follow these steps: |
104 | 106 |
|
105 | | -1. [Provision an Azure Active Directory administrator](/azure/sql-database/sql-database-aad-authentication-configure#provision-an-azure-active-directory-administrator-for-your-managed-instance) for your managed instance on the Azure portal, if you haven't already done so. The Azure AD administrator can be an Azure AD user or Azure AD group. If you grant the group with managed identity an admin role, skip step 2-4. The administrator will have full access to the database. |
| 107 | +1. [Provision an AAD administrator](/azure/sql-database/sql-database-aad-authentication-configure.md#provision-an-azure-active-directory-administrator-for-your-managed-instance) for your Azure SQL Managed Instance in Azure portal, if you haven't already done so. The AAD administrator can be an AAD user or group. If you grant the group with specified system/user-assigned managed identity for your ADF an admin role, skip step 2 - 4. The administrator will have full access to your Azure SQL Managed Instance. |
106 | 108 |
|
107 | | -1. [Create logins](../../t-sql/statements/create-login-transact-sql.md?view=azuresqldb-mi-current&preserve-view=true) for the data factory managed identity. In SQL Server Management Studio (SSMS), connect to your Managed Instance using a SQL Server account that is a **sysadmin**. In **master** database, run the following T-SQL: |
| 109 | +1. [Create a login](../../t-sql/statements/create-login-transact-sql.md?view=azuresqldb-mi-current&preserve-view=true) assigned to the specified system/user-assigned managed identity for your ADF. On SSMS, connect to your Azure SQL Managed Instance using SQL Server account that is a **sysadmin**. In **master** database, run the following T-SQL statement: |
108 | 110 |
|
109 | | - ```sql |
110 | | - CREATE LOGIN [your data factory name] FROM EXTERNAL PROVIDER; |
111 | | - ``` |
| 111 | + ```sql |
| 112 | + CREATE LOGIN [your managed identity name] FROM EXTERNAL PROVIDER; |
| 113 | + ``` |
112 | 114 |
|
113 | | -1. [Create contained database users](/azure/sql-database/sql-database-aad-authentication-configure#create-contained-database-users-in-your-database-mapped-to-azure-ad-identities) for the data factory managed identity. Connect to the database from or to which you want to copy data, run the following T-SQL: |
| 115 | + If you use the system managed identity for your ADF, then *your managed identity name* should be your ADF name. If you use a user-assigned managed identity for your ADF, then *your managed identity name* should be the specified user-assigned managed identity name. |
| 116 | + |
| 117 | +1. [Create a contained database user](/azure/sql-database/sql-database-aad-authentication-configure.md#create-contained-database-users-in-your-database-mapped-to-azure-ad-identities) representing the specified system/user-assigned managed identity for your ADF. Connect to the database from or to which you want to copy data using SSMS and run the following T-SQL statement: |
114 | 118 |
|
115 | | - ```sql |
116 | | - CREATE USER [your data factory name] FROM EXTERNAL PROVIDER; |
117 | | - ``` |
| 119 | + ```sql |
| 120 | + CREATE USER [your managed identity name] FROM EXTERNAL PROVIDER; |
| 121 | + ``` |
118 | 122 |
|
119 | | -1. Grant the data factory managed identity needed permissions as you normally do for SQL users and others. Run the following code. For more options, see [this document](../../t-sql/statements/alter-role-transact-sql.md?view=azuresqldb-mi-current&preserve-view=true). |
| 123 | +1. Grant the specified system/user-assigned managed identity for your ADF the required permissions, as you normally do for SQL users. Run the following T-SQL statement. For more options, see [this article](../../t-sql/statements/alter-role-transact-sql.md?view=azuresqldb-mi-current&preserve-view=true). |
120 | 124 |
|
121 | | - ```sql |
122 | | - ALTER ROLE [role name e.g., db_owner] ADD MEMBER [your data factory name]; |
123 | | - ``` |
| 125 | + ```sql |
| 126 | + ALTER ROLE [role name e.g., db_owner] ADD MEMBER [your managed identity name]; |
| 127 | + ``` |
124 | 128 |
|
125 | | -Finally, configure managed identity authentication for the ADO.NET connection manager. Here are the options to do this: |
126 | | - |
127 | | -- **Configure at design time.** In SSIS Designer, right-click the ADO.NET connection manager, and select **Properties**. Update the property `ConnectUsingManagedIdentity` to `True`. |
128 | | - > [!NOTE] |
129 | | - > Currently, the connection manager property `ConnectUsingManagedIdentity` doesn't take effect (indicating that managed identity authentication doesn't work) when you run SSIS package in SSIS Designer or [!INCLUDE[msCoName](../../includes/msconame-md.md)] SQL Server. |
| 129 | +Finally, you can configure AAD authentication with the specified system/user-assigned managed identity for your ADF on the ADO.NET connection manager. Here are the options to do this: |
130 | 130 |
|
131 | | -- **Configure at runtime.** When you run the package via [SQL Server Management Studio (SSMS)](../ssis-quickstart-run-ssms.md) or [Azure Data Factory Execute SSIS Package activity](/azure/data-factory/how-to-invoke-ssis-package-ssis-activity), find the ADO.NET connection manager. Update its property `ConnectUsingManagedIdentity` to `True`. |
132 | | - > [!NOTE] |
133 | | - > In Azure-SSIS integration runtime, all other authentication methods (for example, integrated authentication and password) preconfigured on the ADO.NET connection manager are overridden when managed identity authentication is used to establish a database connection. |
| 131 | +- **Configure at design time.** In SSIS Designer, right-click on your ADO.NET connection manager, and select **Properties**. Update the property `ConnectUsingManagedIdentity` to `True`. |
134 | 132 |
|
135 | | -> [!NOTE] |
136 | | -> To configure managed identity authentication on existing packages, the preferred way is to rebuild your SSIS project with the [latest SSIS Designer](../../ssdt/download-sql-server-data-tools-ssdt.md) at least once. Redeploy that SSIS project to your Azure-SSIS integration runtime, so that the new connection manager property `ConnectUsingManagedIdentity` is automatically added to all ADO.NET connection managers in your SSIS project. The alternative way is to directly use a property override with property path **\Package.Connections[{the name of your connection manager}].Properties[ConnectUsingManagedIdentity]** at runtime. |
| 133 | + > [!NOTE] |
| 134 | + > Currently, the connection manager property `ConnectUsingManagedIdentity` doesn't take effect (indicating that AAD authentication with the specified system/user-assigned managed identity for your ADF doesn't work) when you run your package in SSIS Designer or on SQL Server. |
137 | 135 |
|
138 | | -## See also |
139 | | - [Integration Services (SSIS) Connections](../../integration-services/connection-manager/integration-services-ssis-connections.md) |
140 | | - |
| 136 | +- **Configure at run time.** When you run your package via [SSMS](../ssis-quickstart-run-ssms.md) or [Execute SSIS Package activity in ADF pipeline](/azure/data-factory/how-to-invoke-ssis-package-ssis-activity.md), find the ADO.NET connection manager and update its property `ConnectUsingManagedIdentity` to `True`. |
| 137 | + |
| 138 | + > [!NOTE] |
| 139 | + > On Azure-SSIS IR, all other authentication methods (for example, integrated security and password) preconfigured on your ADO.NET connection manager are overridden when using AAD authentication with the specified system/user-assigned managed identity for your ADF. |
| 140 | +
|
| 141 | +To configure AAD authentication with the specified system/user-assigned managed identity for your ADF on your existing packages, the preferred way is to rebuild your SSIS project with the [latest SSIS Designer](../../ssdt/download-sql-server-data-tools-ssdt.md) at least once. Redeploy your SSIS project to run on Azure-SSIS IR, so that the new connection manager property `ConnectUsingManagedIdentity` is automatically added to all ADO.NET connection managers in your project. The alternative way is to directly use property overrides with the property path *\Package.Connections[{the name of your connection manager}].Properties[ConnectUsingManagedIdentity]* assigned to `True` at run time. |
| 142 | + |
| 143 | +## See also |
| 144 | +[ADO.NET Source](../../integration-services/data-flow/ado-net-source.md) |
| 145 | +[ADO.NET Destination](../../integration-services/data-flow/ado-net-destination.md) |
| 146 | +[Integration Services (SSIS) Connections](../../integration-services/connection-manager/integration-services-ssis-connections.md) |
0 commit comments