> ## Documentation Index
> Fetch the complete documentation index at: https://julius.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup Snowflake

> Learn how to securely connect Julius to your Snowflake data warehouse using the authentication method that fits your organization.

## What is Snowflake?

**Snowflake** is a cloud-based data platform for warehousing, analytics, and
data sharing. It supports multiple authentication methods.

## Snowflake Connection Requirements

To connect Julius to your Snowflake account, you'll need:

1. A Snowflake account with the necessary permissions
2. The connection details and credentials for your chosen authentication mode

<Tip>
  Choose the authentication mode that matches your organization's security
  policy. If unsure, ask your Snowflake administrator.
</Tip>

## Connecting Julius to Snowflake

1. Go to your
   [Julius Data Connectors Settings](https://julius.ai/settings/data_connectors)
2. Click **Create new Data Connector**
3. Select **Snowflake** from the available options

<Tabs>
  <Tab title="Username / Password">
    <Steps>
      <Step title="Configure Connection Details" icon="form">
        You'll see a form with the following fields:

        <Note>
          Fields marked with an asterisk (\*) are required to establish a connection.
        </Note>

        <ResponseField name="Connection Name" type="string" required>
          * **What it is:** A friendly name to identify this Snowflake connection
          * **Example:** "Production Warehouse" or "Marketing Analytics"
        </ResponseField>

        <ResponseField name="User" type="string" required>
          * **What it is:** Your individually assigned Snowflake username
        </ResponseField>

        <ResponseField name="Password" type="string" required>
          * **What it is:** The password for your Snowflake account
        </ResponseField>

        <ResponseField name="Account" type="string" required>
          * **What it is:** Your company-wide Snowflake account identifier
        </ResponseField>

        <ResponseField name="DB" type="string" required>
          * **What it is:** The particular database name you want to connect to within snowflake
        </ResponseField>

        <ResponseField name="MFA_TYPE" type="string">
          * **What it is:** Multi-Factor Authentication type if required
        </ResponseField>

        <ResponseField name="Role" type="string">
          * **What it is:** The Snowflake role to use (optional)
        </ResponseField>

        <ResponseField name="Warehouse" type="string">
          * **What it is:** The Snowflake warehouse to use (optional)
        </ResponseField>
      </Step>

      <Step title="Test and Save Connection" icon="check">
        1. Click **Add Connection** to test the connection
        2. Julius will validate your credentials and access
        3. If successful, your connector will be saved and ready to use
        4. If there's an error, check the troubleshooting section below
      </Step>
    </Steps>
  </Tab>

  <Tab title="Programmatic Access Token">
    <Steps>
      <Step title="Configure Connection Details" icon="form">
        You'll see a form with the following fields:

        <Note>
          Fields marked with an asterisk (\*) are required to establish a connection.
        </Note>

        <ResponseField name="Connection Name" type="string" required>
          * **What it is:** A friendly name to identify this Snowflake connection
        </ResponseField>

        <ResponseField name="Access_Token" type="string" required>
          * **What it is:** Your programmatic access token for Snowflake
        </ResponseField>

        <ResponseField name="Account" type="string" required>
          * **What it is:** Your Snowflake account identifier
        </ResponseField>

        <ResponseField name="User" type="string" required>
          * **What it is:** Your Snowflake username
        </ResponseField>

        <ResponseField name="DB" type="string" required>
          * **What it is:** The database you want to connect to
        </ResponseField>

        <ResponseField name="Role" type="string">
          * **What it is:** The Snowflake role to use (optional)
        </ResponseField>

        <ResponseField name="Warehouse" type="string">
          * **What it is:** The Snowflake warehouse to use (optional)
        </ResponseField>
      </Step>

      <Step title="Test and Save Connection" icon="check">
        1. Click **Add Connection** to test the connection
        2. Julius will validate your credentials and access
        3. If successful, your connector will be saved and ready to use
        4. If there's an error, check the troubleshooting section below
      </Step>
    </Steps>
  </Tab>

  <Tab title="Private Key Authentication">
    <Steps>
      <Step title="Configure Connection Details" icon="form">
        You'll see a form with the following fields:

        <Note>
          Fields marked with an asterisk (\*) are required to establish a connection.
        </Note>

        <ResponseField name="Connection Name" type="string" required>
          * **What it is:** A friendly name to identify this Snowflake connection
        </ResponseField>

        <ResponseField name="Private_Key" type="string" required>
          * **What it is:** Your private key for authentication (PEM format)
        </ResponseField>

        <ResponseField name="Account" type="string" required>
          * **What it is:** Your Snowflake account identifier
        </ResponseField>

        <ResponseField name="User" type="string" required>
          * **What it is:** Your Snowflake username
        </ResponseField>

        <ResponseField name="DB" type="string" required>
          * **What it is:** The database you want to connect to
        </ResponseField>

        <ResponseField name="Role" type="string">
          * **What it is:** The Snowflake role to use (optional)
        </ResponseField>

        <ResponseField name="Warehouse" type="string">
          * **What it is:** The Snowflake warehouse to use (optional)
        </ResponseField>
      </Step>

      <Step title="Test and Save Connection" icon="check">
        1. Click **Add Connection** to test the connection
        2. Julius will validate your credentials and access
        3. If successful, your connector will be saved and ready to use
        4. If there's an error, check the troubleshooting section below
      </Step>
    </Steps>
  </Tab>

  <Tab title="OAuth (Custom Client)">
    <Steps>
      <Step title="Create Role and OAuth Integration in Snowflake" icon="form">
        Run the following SQL `line by line` in Snowflake with the indicated roles:

        ```sql theme={null}
        -- create the role first (SECURITYADMIN)
        use role SECURITYADMIN;
        create role if not exists JULIUS_APP_ROLE;
        grant role JULIUS_APP_ROLE to user <YOUR_USER>;
        grant role JULIUS_APP_ROLE to role SYSADMIN;

        -- create/alter the integration (ACCOUNTADMIN)
        use role ACCOUNTADMIN;
        create or replace security integration JULIUS_OAUTH
          type = oauth
          enabled = true
          oauth_client = custom
          oauth_client_type = 'CONFIDENTIAL'
          oauth_redirect_uri = 'https://api.julius.ai/snowflake/oauth/callback'
          oauth_enforce_pkce = true
          oauth_issue_refresh_tokens = true
          oauth_refresh_token_validity = 7776000
          oauth_client_rsa_public_key = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApf4GJ3CNy6J4Dmw1rQPisPFrKyXNbsEKsHc38kdIWCscLJsroOUPsfAuynIYSIgvMgNIa/seVRm2Bld0ZFS2W5Mx24nn0lXnkuZQCqv2r6bytPlxw+VQHVV3L5PUVQXS0XF+3zQ1o/ty8RT2Cy0Z3JcI0L7kLMFwK/ouFClmSlRjtgmW/atap2R42RDwfd2JsIGa2LdUvzbmwq3c/P8KBQzUJDCtLR6bqY/447TGyRWhsDRlww7dXki32me65bBrwx21gWHoAYP1MEa+o35kzQ+6WwzwZZpG3abqfTSWrqkKj8lErLkD7imXXx3/F6KWSPcK5tJxt/b02c0GO1kYywIDAQAB'
          pre_authorized_roles_list = ('JULIUS_APP_ROLE');

        alter security integration JULIUS_OAUTH
          set blocked_roles_list = ('ACCOUNTADMIN','SECURITYADMIN','SYSADMIN','USERADMIN');

        describe integration JULIUS_OAUTH;
        ```
      </Step>

      <Step title="Test and Save Connection" icon="check">
        1. Select the OAuth option in Julius and paste the output of the describe command above
        2. Complete the OAuth consent screen when prompted
        3. Julius will validate your access and save the connector
        4. If there's an error, check the troubleshooting section below
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Troubleshooting Common Issues

<Accordion title="Authentication failed or invalid credentials">
  * Double-check your username, password, access token, or private key - Ensure
    your Snowflake account identifier is correct - Verify your user has permission
    to access the specified database
</Accordion>

<Accordion title="Permission denied errors">
  * Verify your user or role has the necessary privileges - Check if the
    warehouse is running and accessible - Ensure the database and schema exist
</Accordion>

<Accordion title="Julius can't find my tables or data">
  * Confirm your user has read permissions on the tables - Check that you're
    connected to the correct database and schema - Verify table names and schemas
    are accessible to your user account
</Accordion>

## Security & Best Practices

* **Use least-privilege credentials** for your Snowflake connections
* **Rotate credentials** regularly and follow your organization's security
  policies
* **Monitor usage** and audit access to your Snowflake account

<Tip>
  If you need help with Snowflake connection setup, contact your Snowflake
  administrator or see the [official
  documentation](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html).
</Tip>

***

<Info>
  Reach out to [**team@julius.ai**](mailto:team@julius.ai) for support or to ask
  questions not answered in our documentation.
</Info>
