DataGrip 2025.1 Help

Create a Snowflake data source with key pair authentication

Before connecting to a Snowflake database with key pair authentication, make sure to generate your key files and provide your public key file to your system administrator first.

Once the key files are ready, you need to create a Snowflake data source in DataGrip and configure it to use it with key pair authentication.

Create a Snowflake data source to use with key pair authenticatoin

  1. In the Database Explorer (⌘ 1) , click the New icon New on the toolbar and navigate to Data Source | Snowflake.

    Create a new Snowflake data source
  2. Check if there is a Download missing driver files link at the bottom of the connection settings area. Click this link to download drivers that are required to interact with a database. For a direct download link, refer to the JetBrains JDBC drivers page.

    The Download missing driver files link
  3. Specify the database connection details.

    1. In the Host field, type the URL to connect to your Snowflake account with. For example, myorg-myconnection.snowflakecomputing.com.

    2. From the Authentication dropdown, select Authenticator.

    3. In the Authenticator field, type snowflake_jwt.

    4. In the User field, type your Snowflake username.

    5. Leave the Password field empty.

    6. In the Database field, type the database name to which you want to connect.

    7. In the Schema field, type the schema name to which you want to connect.

    8. In the Warehouse field, type the name of a compute resources cluster in Snowflake that you want to use.

  4. On the SSH/SSL tab of Data Sources and Drivers dialog, select the Use SSL checkbox.

  5. In the Client key file field, click the Browse icon Browse, navigate to your .p8 private key file, select it and click Open.

    DataGrip supports using private key files in WSL on Windows. To do this, specify the WSL path for your private key file. For example, \\wsl$\Ubuntu\home\myuser\snowflake\rsa_key.p8.

  6. For an encrypted private key file, type the passphrase you used when creating it in the Client key password field.

  7. Click the Test Connection link at the bottom of the connection details area to initiate a test connection to your database.

    Test Connection link
  8. In the IDE, click OK to save your new data source.

Alternatively to specifying connection details in dedicated fields, type your JDBC URL in the URL field of General tab. The general URL to use is as follows:

  • Format:

    jdbc:snowflake://<organization_name>-<connection_name>.snowflakecomputing.com/?warehouse=<warehouse_name>&db=<database_name>&schema=<schema_name>&user=<snowflake_username>&private_key_file=<path_to_key_file>

  • Example:

    jdbc:snowflake://myorg-myconnection.snowflakecomputing.com/?warehouse=AUTH_WH&db=TESTDB&schema=MYSCHEMA&user=MYUSERNAME&private_key_file=/home/myuser/snowflake/rsa_key.p8

    jdbc:snowflake://myorg-myconnection.snowflakecomputing.com/?warehouse=AUTH_WH&db=TESTDB&schema=MYSCHEMA&user=MYUSERNAME&private_key_file=С:/Users/myuser/snowflake/rsa_key.p8

    jdbc:snowflake://myorg-myconnection.snowflakecomputing.com/?warehouse=AUTH_WH&db=TESTDB&schema=MYSCHEMA&user=MYUSERNAME&private_key_file=//wsl$/Ubuntu/home/myuser/snowflake/rsa_key.p8

    jdbc:snowflake://myorg-myconnection.snowflakecomputing.com/?warehouse=AUTH_WH&db=TESTDB&schema=MYSCHEMA&user=MYUSERNAME&private_key_file=/Users/myuser/snowflake/rsa_key.p8

In this case, make sure to enable SSL connection on the SSH/SSL tab of the dialog. Also, provide your passphrase in the corresponding field, if required.

  • General tab

    Database connection details
  • SSH/SSL tab

    Database connection details
Last modified: 15 May 2025