# Add a Snowflake connector

## Connector features

You can use the Toucan Snowflake connector to connect to your Snowflake account with a key-pair authentication or basic authentication and access `tables` or `views` with a SQL query or by [using our no-code form ](https://docs-v3.toucantoco.com/data-management-in-datahub/datasources-in-toucan/managing-connectors/create-a-dataset-from-a-connector/code-mode-and-single-mode).

With this connection, you can fetch data from your Snowflake to fill your charts and dashboards.

{% hint style="info" %}
**Changelog**

**December 23**

* This connector is [NativeSQL](https://docs-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/preparing-data/youprep-tm-native-sql) compatible<br>

**November 2024**

* This connector supports [hybrid pipelines](https://docs-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/preparing-data/hybrid-pipeline)

**September 25**

* This connector supports key-pair authentification following [Snowflake rules](https://www.snowflake.com/en/blog/blocking-single-factor-password-authentification)<br>

**October 25**

* This data connector is supported for connection and [NativeSQL](https://docs-v3.toucantoco.com/data-management-in-datahub/datasources-in-toucan/managing-connectors/create-a-dataset-from-a-connector/code-mode-and-single-mode) by our new [Data Execution system](https://docs-v3.toucantoco.com/data-management-in-datahub/new-data-execution-system)

**February 26**

* Modification of the account name format
  {% endhint %}

## Configuring a Snowflake connection

Follow the steps described in [..](https://docs-v3.toucantoco.com/data-management-in-datahub/datasources-in-toucan/managing-connectors/setting-up-a-connector "mention"), choose `Snowflake` and fill out the form with the following info:

<table><thead><tr><th>Field</th><th>Format / Type</th><th width="263.109375">Description</th><th>Example</th></tr></thead><tbody><tr><td>Name (mandatory)</td><td>String</td><td>Use it to identify your connection</td><td><em>MySnowflakeConnection</em></td></tr><tr><td>Account (mandatory)</td><td>String</td><td>in the <code>orgname-accountname</code> format. <a href="https://docs.snowflake.net/manuals/user-guide/python-connector-api.html#label-account-format-info">You can read more about it here</a></td><td>&#x3C;<em>account_identifier></em></td></tr><tr><td>Authentication method (mandatory)</td><td>Enum</td><td>List with <code>Snowflake (ID+Password)</code> (deprecated by Snowflake in November 2025) <code>Key pair</code> and <code>oAuth</code> (deprecated)</td><td><em>Key pair</em></td></tr><tr><td>User</td><td>String</td><td><br>- <code>Snowflake (ID+Password)</code><br>- <code>Key pair</code><br>The user with rights to access to the Snowflake database</td><td>my_snowflake_user</td></tr><tr><td>Password</td><td>String</td><td><p>- <code>Snowflake (ID+Password)</code><br>- <code>Key pair</code></p><p>Password associated to the user or to the private key if your key is protected by a password (will be stored as a secret)</p></td><td><em>mysecretpassword</em></td></tr><tr><td>Private Key</td><td>String</td><td><p>- <code>Key pair</code></p><p>the key generated to access to your Snowflake database the key in <strong>PEM-encoded PKCS#8 format</strong><br>(will be stored as a secret)</p></td><td><em>-----BEGIN ENCRYPTED PRIVATE KEY-----</em><br><em>MIIJpDBW[...]-----END ENCRYPTED PRIVATE KEY-----</em></td></tr><tr><td>Token Endpoint<br></td><td>String</td><td><p>- <code>oAuth</code></p><p>The token endpoint URL</p></td><td><em>https://&#x3C;your_snowflake_account>.snowflakecomputing.com/oauth/token-request</em></td></tr><tr><td>Token Endpoint Content Type</td><td>String</td><td><p>- <code>oAuth</code></p><p>The content type to use when requesting the token endpoint</p></td><td><em>application/x-www-form-urlencoded</em></td></tr><tr><td>Role (optional)</td><td>String</td><td>The user role that you want to connect with. See more details <a href="https://docs.snowflake.com/en/user-guide/admin-user-management.html#user-roles">here</a>.</td><td><em>USER</em></td></tr><tr><td>Default Warehouse (mandatory)</td><td>String</td><td>The default warehouse that shall be used for any data source</td><td><em>COMPUTE_WH</em></td></tr><tr><td>Retry Policy (optional)</td><td>Boolean</td><td><p><em>Boolean</em> allows to configure a retry policy if the connection is flaky.</p><ul><li>max attempts: maximum number of retries before giving up</li><li>max_delay: in seconds, above the connection is dropped</li><li>wait_time: time in seconds between each retry</li></ul></td><td></td></tr><tr><td>Slow Queries' Cache Expiration Time (optional)</td><td>Integer</td><td>Slow queries' cache expiration time in seconds</td><td></td></tr></tbody></table>

* Click on the `TEST CONNECTION` button then `SAVE` the connection

  {% hint style="success" %} After successfully configuring the connector, you will be able to find it in the Connector section of the DataHub "Datasource" tab {% endhint %}

## Create a dataset from a Snowflake connection

{% hint style="info" %}
This data connector is supported in [simple and code/SQL mode](https://docs-v3.toucantoco.com/data-management-in-datahub/datasources-in-toucan/managing-connectors/create-a-dataset-from-a-connector/code-mode-and-single-mode) with:

* our current Data Execution system
* our new [Data Execution System](https://docs-v3.toucantoco.com/new-data-execution-system#general)
  {% endhint %}

To create a dataset from Snowflake, click on the "create from" icon, you will then be able to:

* Select the `Database`
* Select the `Data warehouse`
* Select the `Schema`
* Select `Table` or `Views`
* Only keep the columns you need

{% hint style="info" %}
For more info, see the dedicated section [creating-datasets](https://docs-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/managing-datasets/creating-datasets "mention")
{% endhint %}

{% hint style="success" %}
After selecting data from your connector you will be able to create a dataset thanks to [YouPrep](https://docs-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/preparing-data/overview-of-youprep-tm) using the selection as "source step".
{% endhint %}

### How to troubleshoot a Snowflake connection

Generally ensure all mandatory fields (`Name`, `Account`, `User`, `Private Key`, `Password` if your private Key is protected by a password) are filled.

#### Test connection modal

Use the [#test-connection](https://docs-v3.toucantoco.com/data-management-in-datahub/datasources-in-toucan/managing-connectors/..#test-connection "mention") modal to troubleshoot a misconfiguration

The Snowflake test connection modal is composed fo two steps:

* `Connection to Snowflake` : check if Toucan is allowed to connect to Snowflake, on the network, the `account` listed is a Snowflake account, the `user` and `private key` are valid means of authentication.
* `Default warehouse exists` : checks if the Default Warehouse entered is valid / or accessible to your user.

#### Network access

Verify that your Snowflake account is **reachable** from Toucan IP and is not blocked by firewalls.

If you have made an error entering your account, you will have an

`internal server error`

{% hint style="info" %}
Check our IP for our [Current Data Execution System](https://toucantoco.com/public-servers-list.html) and [New Data Execution System](https://docs-v3.toucantoco.com/new-data-execution-system#ip-allowlisting)
{% endhint %}

#### Authentication

If the modal displays a warning icon on `Connection to Snowflake` line and the message displayed is:

`Connection failed for the user '{{user_entered}}', please check your credentials`

* Confirm `User` , `Private Key`, `Password` are valid and have been granted connect permissions to the target warehouse.

#### Other options

**Default warehouse**

If the modal displays a warning icon on `Default warehouse exists` line and the message displayed is:

`The warehouse '{{YOUR_WAREHOUSE}}' does not exist.`

* Check the spelling of the warehouse that it exists or that your user has access to it.

**Advanced troubleshooting**

* Review logs on your Snowflake account for more detailed error information.
* For persistent issues, attempt to connect using CLI with the same parameters to isolate issues.
