Skip to content

Commit f9bc3ff

Browse files
Merge pull request #215966 from jess-hu-340/1026-update-OAuth-Basic
[New feature] Add OAuth2 authentication to Snowflake
2 parents 8563163 + 5aa6e82 commit f9bc3ff

File tree

1 file changed

+77
-3
lines changed

1 file changed

+77
-3
lines changed

articles/data-factory/connector-snowflake.md

Lines changed: 77 additions & 3 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: 08/24/2022
11+
ms.date: 10/26/2022
1212
---
1313

1414
# Copy and transform data in Snowflake using Azure Data Factory or Azure Synapse Analytics
@@ -85,12 +85,22 @@ The following sections provide details about properties that define entities spe
8585

8686
## Linked service properties
8787

88-
The following properties are supported for a Snowflake-linked service.
88+
This Snowflake connector supports the following authentication types. See the corresponding sections for details.
89+
90+
91+
92+
- [Basic authentication](#basic-authentication)
93+
- [OAuth authentication](#oauth-authentication)
94+
95+
### Basic authentication
96+
97+
The following properties are supported for a Snowflake linked service when using **Basic** authentication.
8998

9099
| Property | Description | Required |
91100
| :--------------- | :----------------------------------------------------------- | :------- |
92101
| type | The type property must be set to **Snowflake**. | Yes |
93-
| connectionString | Specifies the information needed to connect to the Snowflake instance. You can choose to put password or entire connection string in Azure Key Vault. Refer to the examples below the table, as well as the [Store credentials in Azure Key Vault](store-credentials-in-key-vault.md) article, for more details.<br><br>Some typical settings:<br>- **Account name:** The [full account name](https://docs.snowflake.net/manuals/user-guide/connecting.html#your-snowflake-account-name) of your Snowflake account (including additional segments that identify the region and cloud platform), e.g. xy12345.east-us-2.azure.<br/>- **User name:** The login name of the user for the connection.<br>- **Password:** The password for the user.<br>- **Database:** The default database to use once connected. It should be an existing database for which the specified role has privileges.<br>- **Warehouse:** The virtual warehouse to use once connected. It should be an existing warehouse for which the specified role has privileges.<br>- **Role:** The default access control role to use in the Snowflake session. The specified role should be an existing role that has already been assigned to the specified user. The default role is PUBLIC. | Yes |
102+
| connectionString | Specifies the information needed to connect to the Snowflake instance. You can choose to put password or entire connection string in Azure Key Vault. Refer to the examples below the table, and the [Store credentials in Azure Key Vault](store-credentials-in-key-vault.md) article, for more details.<br><br>Some typical settings:<br>- **Account name:** The [full account name](https://docs.snowflake.net/manuals/user-guide/connecting.html#your-snowflake-account-name) of your Snowflake account (including additional segments that identify the region and cloud platform), e.g. xy12345.east-us-2.azure.<br/>- **User name:** The login name of the user for the connection.<br>- **Password:** The password for the user.<br>- **Database:** The default database to use once connected. It should be an existing database for which the specified role has privileges.<br>- **Warehouse:** The virtual warehouse to use once connected. It should be an existing warehouse for which the specified role has privileges.<br>- **Role:** The default access control role to use in the Snowflake session. The specified role should be an existing role that has already been assigned to the specified user. The default role is PUBLIC. | Yes |
103+
| authenticationType  | Set this property to **Basic**. | Yes    |
94104
| connectVia | The [integration runtime](concepts-integration-runtime.md) that is used to connect to the data store. You can use the Azure integration runtime or a self-hosted integration runtime (if your data store is located in a private network). If not specified, it uses the default Azure integration runtime. | No |
95105

96106
**Example:**
@@ -101,6 +111,7 @@ The following properties are supported for a Snowflake-linked service.
101111
"properties": {
102112
"type": "Snowflake",
103113
"typeProperties": {
114+
"authenticationType": "Basic",
104115
"connectionString": "jdbc:snowflake://<accountname>.snowflakecomputing.com/?user=<username>&password=<password>&db=<database>&warehouse=<warehouse>&role=<myRole>"
105116
},
106117
"connectVia": {
@@ -119,6 +130,7 @@ The following properties are supported for a Snowflake-linked service.
119130
"properties": {
120131
"type": "Snowflake",
121132
"typeProperties": {
133+
"authenticationType": "Basic",
122134
"connectionString": "jdbc:snowflake://<accountname>.snowflakecomputing.com/?user=<username>&db=<database>&warehouse=<warehouse>&role=<myRole>",
123135
"password": {
124136
"type": "AzureKeyVaultSecret",
@@ -137,6 +149,68 @@ The following properties are supported for a Snowflake-linked service.
137149
}
138150
```
139151

152+
### OAuth authentication
153+
154+
The following properties are supported for a Snowflake linked service when using **OAuth** authenticaition.
155+
156+
| Property         | Description                                                  | Required |
157+
| :--------------- | :----------------------------------------------------------- | :------- |
158+
| type             | The type property must be set to **Snowflake**.              | Yes      |
159+
| connectionString | Specifies the information needed to connect to the Snowflake instance. You can choose to put password or entire connection string in Azure Key Vault. Refer to the examples below the table, as well as the [Store credentials in Azure Key Vault](store-credentials-in-key-vault.md) article, for more details.<br><br>Some typical settings:<br>- **Account name:** The  [full account name](https://docs.snowflake.net/manuals/user-guide/connecting.html#your-snowflake-account-name) of your Snowflake account (including additional segments that identify the region and cloud platform), e.g. xy12345.east-us-2.Azure.<br/>- **User name:** The login name of the user for the connection.<br>- **Database:** The default database to use once connected. It should be an existing database for which the specified role has privileges.<br>- **Warehouse:** The virtual warehouse to use once connected. It should be an existing warehouse for which the specified role has privileges.<br>- **Role:** The default access control role to use in the Snowflake session. The specified role should be an existing role that has already been assigned to the specified user. The default role is PUBLIC. | Yes      |
160+
| authenticationType | Set this property to **Oauth**.<br>It supports External OAuth for Microsoft Azure AD. To learn more about this, see this [article](https://docs.snowflake.com/en/user-guide/oauth-ext-overview.html).| Yes      |
161+
| oauthTokenEndpoint        | The Azure AD OAuth token endpoint. Sample: `https://login.microsoftonline.com/<tenant ID>/discovery/v2.0/keys`| Yes       |
162+
| clientId  | The application client ID supplied by Azure AD . | Yes      |
163+
| clientSecret  | The client secret corresponds to the client ID.  | Yes      |
164+
| oauthUserName  | The name of the Azure user.  | Yes      |
165+
| oauthPassword   | The password for the Azure user. | Yes      |
166+
| scope   | The OAuth scope. Sample: `api://<application (client) ID>/session:scope:MYROLE` | Yes      |
167+
| connectVia | The [integration runtime](concepts-integration-runtime.md) that is used to connect to the data store. You can use the Azure integration runtime or a self-hosted integration runtime (if your data store is located in a private network). If not specified, it uses the default Azure integration runtime. | No |
168+
169+
**Example:**
170+
171+
```json
172+
{
173+
    "name": "SnowflakeLinkedService",
174+
    "type": "Microsoft.DataFactory/factories/linkedservices",
175+
    "properties": {
176+
        "annotations": [],
177+
        "type": "Snowflake",
178+
        "typeProperties": {
179+
            "connectionString": "jdbc:snowflake://<accountname>.snowflakecomputing.com/?user=<username>&db=<database>&warehouse=<warehouse>&role=<myRole>",
180+
            "authenticationType": "Oauth",
181+
            "oauthTokenEndpoint": "https://login.microsoftonline.com/<tenant ID>/discovery/v2.0/keys",
182+
            "clientId": "<client Id>",
183+
            "clientSecret": {
184+
                "type": "AzureKeyVaultSecret",
185+
                "store": {
186+
                    "referenceName": "<Azure Key Vault linked service name>",
187+
                    "type": "LinkedServiceReference"
188+
                },
189+
                "secretName": "<secret name>",
190+
            },
191+
            "oauthUserName": "<user name>",
192+
            "oauthPassword": {
193+
                "type": "AzureKeyVaultSecret",
194+
                "store": {
195+
                    "referenceName": "<Azure Key Vault linked service name>",
196+
                    "type": "LinkedServiceReference"
197+
                },
198+
                "secretName": "<secret name>",
199+
            },
200+
            "scope": "api://<application (client) ID>/session:scope:MYROLE",
201+
        },
202+
"connectVia": {
203+
"referenceName": "<name of Integration Runtime>",
204+
"type": "IntegrationRuntimeReference"
205+
}
206+
    }
207+
}
208+
209+
```
210+
211+
>[!Note]
212+
>Currently, the OAuth authentication is not supported in mapping data flow and script activity.
213+
140214
## Dataset properties
141215

142216
For a full list of sections and properties available for defining datasets, see the [Datasets](concepts-datasets-linked-services.md) article.

0 commit comments

Comments
 (0)