Skip to content

Commit c54bb75

Browse files
Merge pull request #279282 from Clare-Zheng82/0626-Add_UAMI_auth_section_to_SQL_server
[New feature] Add UAMI auth section to SQL server doc
2 parents 2eeeea1 + eb61092 commit c54bb75

File tree

1 file changed

+62
-2
lines changed

1 file changed

+62
-2
lines changed

articles/data-factory/connector-sql-server.md

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: data-factory
88
ms.subservice: data-movement
99
ms.topic: conceptual
1010
ms.custom: synapse
11-
ms.date: 06/17/2024
11+
ms.date: 06/26/2024
1212
---
1313

1414
# Copy and transform data to and from SQL Server by using Azure Data Factory or Azure Synapse Analytics
@@ -99,7 +99,7 @@ These generic properties are supported for a SQL server linked service when you
9999
| type | The type property must be set to **SqlServer**. | Yes |
100100
| server | The name or network address of the SQL server instance you want to connect to. | Yes |
101101
| database | The name of the database. | Yes |
102-
| authenticationType |The type used for authentication. Allowed values are [**SQL**](#sql-authentication) (default), [**Windows**](#windows-authentication). Go to the relevant authentication section on specific properties and prerequisites. | Yes |
102+
| authenticationType |The type used for authentication. Allowed values are [**SQL**](#sql-authentication) (default), [**Windows**](#windows-authentication) and [**UserAssignedManagedIdentity**](#user-assigned-managed-identity-authentication) (only for [SQL Server on Azure VMs](/azure/azure-sql/virtual-machines)). Go to the relevant authentication section on specific properties and prerequisites. | Yes |
103103
| alwaysEncryptedSettings | Specify **alwaysencryptedsettings** information that's needed to enable Always Encrypted to protect sensitive data stored in SQL server by using either managed identity or service principal. For more information, see the JSON example following the table and [Using Always Encrypted](#using-always-encrypted) section. If not specified, the default always encrypted setting is disabled. |No |
104104
| encrypt |Indicate whether TLS encryption is required for all data sent between the client and server. Options: mandatory (for true, default)/optional (for false)/strict. | No |
105105
| trustServerCertificate | Indicate whether the channel will be encrypted while bypassing the certificate chain to validate trust. | No |
@@ -280,6 +280,66 @@ To use Windows authentication, in addition to the generic properties that are de
280280
}
281281
```
282282

283+
#### User-assigned managed identity authentication
284+
285+
>[!Note]
286+
>The user-assigned managed identity authentication only applies to [SQL Server on Azure VMs](/azure/azure-sql/virtual-machines).
287+
288+
A data factory or Synapse workspace can be associated with a [user-assigned managed identities](data-factory-service-identity.md#user-assigned-managed-identity) that represents the service when authenticating to other resources in Azure. You can use this managed identity for [SQL Server on Azure VMs](/azure/azure-sql/virtual-machines) authentication. The designated factory or Synapse workspace can access and copy data from or to your database by using this identity.
289+
290+
To use user-assigned managed identity authentication, in addition to the generic properties that are described in the preceding section, specify the following properties:
291+
292+
| Property | Description | Required |
293+
|:--- |:--- |:--- |
294+
| credentials | Specify the user-assigned managed identity as the credential object. | Yes |
295+
296+
You also need to follow the steps below:
297+
298+
1. [Grant permissions to your user-assigned managed identity](/azure/azure-sql/virtual-machines/windows/configure-azure-ad-authentication-for-sql-vm#grant-permissions).
299+
300+
1. [Enable Microsoft Entra authentication](/azure/azure-sql/virtual-machines/windows/configure-azure-ad-authentication-for-sql-vm#enable-microsoft-entra-authentication) to your [SQL Server on Azure VMs](/azure/azure-sql/virtual-machines).
301+
302+
1. [Create contained database users](/azure/azure-sql/database/authentication-aad-configure#create-contained-users-mapped-to-azure-ad-identities) for the user-assigned managed identity. Connect to the database from or to which you want to copy data by using tools like SQL Server Management Studio, with a Microsoft Entra identity that has at least ALTER ANY USER permission. Run the following T-SQL:
303+
304+
```sql
305+
CREATE USER [your_resource_name] FROM EXTERNAL PROVIDER;
306+
```
307+
308+
1. [Create one or multiple user-assigned managed identities](../active-directory/managed-identities-azure-resources/how-to-manage-ua-identity-portal.md) and grant the user-assigned managed identity needed permissions as you normally do for SQL users and others. Run the following code. For more options, see [this document](/sql/relational-databases/system-stored-procedures/sp-addrolemember-transact-sql).
309+
310+
```sql
311+
ALTER ROLE [role name] ADD MEMBER [your_resource_name];
312+
```
313+
1. Assign one or multiple user-assigned managed identities to your data factory and [create credentials](credentials.md) for each user-assigned managed identity.
314+
315+
1. Configure a SQL Server linked service.
316+
317+
**Example**
318+
319+
```json
320+
{
321+
"name": "SqlServerLinkedService",
322+
"properties": {
323+
"type": "SqlServer",
324+
"typeProperties": {
325+
"server": "<name or network address of the SQL server instance>",
326+
"database": "<database name>",
327+
"encrypt": "<encrypt>",
328+
"trustServerCertificate": false,
329+
"authenticationType": "UserAssignedManagedIdentity",
330+
"credential": {
331+
"referenceName": "credential1",
332+
"type": "CredentialReference"
333+
}
334+
},
335+
"connectVia": {
336+
"referenceName": "<name of Integration Runtime>",
337+
"type": "IntegrationRuntimeReference"
338+
}
339+
}
340+
}
341+
```
342+
283343
### Legacy version
284344

285345
These generic properties are supported for a SQL server linked service when you apply **Legacy** version:

0 commit comments

Comments
 (0)