Skip to content

Commit 492850c

Browse files
authored
Merge pull request #205627 from Clare-Zheng82/0722-Update_SQL_server_auth_section
Update Linked service properties section in SQL server doc
2 parents ef5b55c + de38c10 commit 492850c

File tree

1 file changed

+76
-31
lines changed

1 file changed

+76
-31
lines changed

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

Lines changed: 76 additions & 31 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: 03/22/2022
11+
ms.date: 07/20/2022
1212
---
1313

1414
# Copy and transform data to and from SQL Server by using Azure Data Factory or Azure Synapse Analytics
@@ -83,24 +83,27 @@ The following sections provide details about properties that are used to define
8383

8484
## Linked service properties
8585

86-
The following properties are supported for the SQL Server linked service:
86+
This SQL server connector supports the following authentication types. See the corresponding sections for details.
87+
88+
- [SQL authentication](#sql-authentication)
89+
- [Windows authentication](#windows-authentication)
90+
91+
>[!TIP]
92+
>If you hit an error with the error code "UserErrorFailedToConnectToSqlServer" and a message like "The session limit for the database is XXX and has been reached," add `Pooling=false` to your connection string and try again.
93+
94+
### SQL authentication
95+
96+
To use SQL authentication, the following properties are supported:
8797

8898
| Property | Description | Required |
8999
|:--- |:--- |:--- |
90100
| type | The type property must be set to **SqlServer**. | Yes |
91-
| connectionString |Specify **connectionString** information that's needed to connect to the SQL Server database by using either SQL authentication or Windows authentication. Refer to the following samples.<br/>You also can put a password in Azure Key Vault. If it's SQL authentication, pull the `password` configuration out of the connection string. For more information, see the JSON example following the table and [Store credentials in Azure Key Vault](store-credentials-in-key-vault.md). |Yes |
92-
| userName |Specify a user name if you use Windows authentication. An example is **domainname\\username**. |No |
93-
| password |Specify a password for the user account you specified for the user name. Mark this field as **SecureString** to store it securely. Or, you can [reference a secret stored in Azure Key Vault](store-credentials-in-key-vault.md). |No |
101+
| connectionString | Specify **connectionString** information that's needed to connect to the SQL Server database. Specify a login name as your user name, and ensure the database that you want to connect is mapped to this login. Refer to the following samples. | Yes |
102+
| password | If you want to put a password in Azure Key Vault, pull the `password` configuration out of the connection string. For more information, see the JSON example following the table and [Store credentials in Azure Key Vault](store-credentials-in-key-vault.md). |No |
94103
| 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 |
95104
| connectVia | This [integration runtime](concepts-integration-runtime.md) is used to connect to the data store. Learn more from [Prerequisites](#prerequisites) section. If not specified, the default Azure integration runtime is used. |No |
96105

97-
> [!NOTE]
98-
> Windows authentication is not supported in data flow.
99-
100-
>[!TIP]
101-
>If you hit an error with the error code "UserErrorFailedToConnectToSqlServer" and a message like "The session limit for the database is XXX and has been reached," add `Pooling=false` to your connection string and try again.
102-
103-
**Example 1: Use SQL authentication**
106+
**Example: Use SQL authentication**
104107

105108
```json
106109
{
@@ -117,8 +120,7 @@ The following properties are supported for the SQL Server linked service:
117120
}
118121
}
119122
```
120-
121-
**Example 2: Use SQL authentication with a password in Azure Key Vault**
123+
**Example: Use SQL authentication with a password in Azure Key Vault**
122124

123125
```json
124126
{
@@ -127,13 +129,13 @@ The following properties are supported for the SQL Server linked service:
127129
"type": "SqlServer",
128130
"typeProperties": {
129131
"connectionString": "Data Source=<servername>\\<instance name if using named instance>;Initial Catalog=<databasename>;Integrated Security=False;User ID=<username>;",
130-
"password": { 
131-
"type": "AzureKeyVaultSecret", 
132-
"store": { 
133-
"referenceName": "<Azure Key Vault linked service name>", 
134-
"type": "LinkedServiceReference" 
135-
}, 
136-
"secretName": "<secretName>" 
132+
"password": {
133+
"type": "AzureKeyVaultSecret",
134+
"store": {
135+
"referenceName": "<Azure Key Vault linked service name>",
136+
"type": "LinkedServiceReference"
137+
},
138+
"secretName": "<secretName>"
137139
}
138140
},
139141
"connectVia": {
@@ -143,8 +145,49 @@ The following properties are supported for the SQL Server linked service:
143145
}
144146
}
145147
```
148+
**Example: Use Always Encrypted**
146149

147-
**Example 3: Use Windows authentication**
150+
```json
151+
{
152+
"name": "SqlServerLinkedService",
153+
"properties": {
154+
"type": "SqlServer",
155+
"typeProperties": {
156+
"connectionString": "Data Source=<servername>\\<instance name if using named instance>;Initial Catalog=<databasename>;Integrated Security=False;User ID=<username>;Password=<password>;"
157+
},
158+
"alwaysEncryptedSettings": {
159+
"alwaysEncryptedAkvAuthType": "ServicePrincipal",
160+
"servicePrincipalId": "<service principal id>",
161+
"servicePrincipalKey": {
162+
"type": "SecureString",
163+
"value": "<service principal key>"
164+
}
165+
},
166+
"connectVia": {
167+
"referenceName": "<name of Integration Runtime>",
168+
"type": "IntegrationRuntimeReference"
169+
}
170+
}
171+
}
172+
```
173+
174+
### Windows authentication
175+
176+
To use Windows authentication, the following properties are supported:
177+
178+
| Property | Description | Required |
179+
|:--- |:--- |:--- |
180+
| type | The type property must be set to **SqlServer**. | Yes |
181+
| connectionString | Specify **connectionString** information that's needed to connect to the SQL Server database. Refer to the following samples.
182+
| userName | Specify a user name. An example is **domainname\\username**. |Yes |
183+
| password | Specify a password for the user account you specified for the user name. Mark this field as **SecureString** to store it securely. Or, you can [reference a secret stored in Azure Key Vault](store-credentials-in-key-vault.md). |Yes |
184+
| 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 [Using Always Encrypted](#using-always-encrypted) section. If not specified, the default always encrypted setting is disabled. |No |
185+
| connectVia | This [integration runtime](concepts-integration-runtime.md) is used to connect to the data store. Learn more from [Prerequisites](#prerequisites) section. If not specified, the default Azure integration runtime is used. |No |
186+
187+
> [!NOTE]
188+
> Windows authentication is not supported in data flow.
189+
190+
**Example: Use Windows authentication**
148191

149192
```json
150193
{
@@ -167,22 +210,24 @@ The following properties are supported for the SQL Server linked service:
167210
}
168211
```
169212

170-
**Example 4: Use Always Encrypted**
213+
**Example: Use Windows authentication with a password in Azure Key Vault**
171214

172215
```json
173216
{
174217
"name": "SqlServerLinkedService",
175218
"properties": {
219+
"annotations": [],
176220
"type": "SqlServer",
177221
"typeProperties": {
178-
"connectionString": "Data Source=<servername>\\<instance name if using named instance>;Initial Catalog=<databasename>;Integrated Security=False;User ID=<username>;Password=<password>;"
179-
},
180-
"alwaysEncryptedSettings": {
181-
"alwaysEncryptedAkvAuthType": "ServicePrincipal",
182-
"servicePrincipalId": "<service principal id>",
183-
"servicePrincipalKey": {
184-
"type": "SecureString",
185-
"value": "<service principal key>"
222+
"connectionString": "Data Source=<servername>\\<instance name if using named instance>;Initial Catalog=<databasename>;Integrated Security=True;",
223+
"userName": "<domain\\username>",
224+
"password": {
225+
"type": "AzureKeyVaultSecret",
226+
"store": {
227+
"referenceName": "<Azure Key Vault linked service name>",
228+
"type": "LinkedServiceReference"
229+
},
230+
"secretName": "<secretName>"
186231
}
187232
},
188233
"connectVia": {

0 commit comments

Comments
 (0)