Connect to Snowflake #

This page describes how to connect to Snowflake from Satori, enabling you to send data to your Snowflake instance for analysis.

Prerequisites #

Before you can connect to Snowflake, you must have the following:

Snowflake UI and CLI Access
Not all actions required can be performed via the Snowflake web interface, you will also need to use the Snowflake CLI.

Create a database #

To create a database for Satori, navigate to your Snowflake instance dashboard and follow these steps:

  1. From the left-hand navigation menu, go to Data > Databases and click + Database:

Databases
Databases

  1. In the displayed modal enter the name for your new database, SatoriDB in this example, and click Create.

Create a user #

To create a user for Satori, navigate to your Snowflake instance dashboard and follow these steps:

  1. From the left-hand navigation menu, go to Admin > Users & Roles and select the Users tab.

  2. Click + User and in the displayed modal enter the details for your new user, SatoriUser in this example:

Create User
Create User

Advanced Settings
Do not select any Default Role or Default Warehouse in the Advanced Settings section.
  1. Click Create User to confirm the changes.

Create a role #

To create a role for Satori, navigate to your Snowflake instance dashboard and follow these steps:

  1. From the left-hand navigation menu, go to Admin > Users & Roles and select the Roles tab:

Users & Roles
Users & Roles

  1. Click + Role and in the displayed modal enter the name for your new role, Satori in this example:

Create Role
Create Role

Granting Permissions
Do not grant any permissions at this time. Those configurations will be performed via the CLI.
  1. Click Create to confirm the changes.

Grant permissions #

To grant the appropriate permissions to the Satori user and role, follow these steps:

  1. Login via SnowSQL using the ACCOUNTADMIN user:
1
sudo snowsql -a <account> -u <admin_user>

You are prompted for your sudo password and then your Snowflake password.

  1. Use the ACCOUNTADMIN role:
1
USE ROLE ACCOUNTADMIN;
  1. Grant the role created above to the Satori user created above:
1
GRANT ROLE SATORI TO USER SATORIUSER;
  1. Grant the following database and schema permissions to the Satori role:
1
GRANT ALL ON ALL schemas in database SATORDIDB TO ROLE SATORI;
  1. Grant the following table permissions to the Satori role:
1
2
GRANT ALL ON ALL TABLES IN SCHEMA PUBLIC TO ROLE SATORI;
GRANT ALL ON ALL TABLES IN SCHEMA SATORIDB.PUBLIC TO ROLE SATORI;
  1. Grant the following warehouse permissions to the Satori role:
1
GRANT ALL ON ALL WAREHOUSE COMPUTE_WH TO ROLE SATORI;
  1. Grant the following database usage permissions to the Satori role:
1
GRANT USAGE ON DATABASE SATORIDB TO ROLE SATORI;
At this point, we recommend that you navigate to the Snowflake web interface and verify that the permissions have been granted correctly.
  1. From the Snowflake UI, navigate to Admin > Users & Roles > Users. For the SATORIUSER, use the options menu and select Edit:

Edit User
Edit User

  1. In the displayed modal, set the Default Role to SATORI and the Default Warehouse to COMPUTE_WH.

    • Optionally, the warehouse may be specified as a query paramenter in the connection string.
  2. Click Save User to confirm the changes.

Configure Snowflake in Satori #

From the Satori dashboard, navigate to Settings > Data Lakes > Snowflake:

  1. Enter the corresponding details:

    • Table Name: The name of the table to which data will be sent, SATORI in this example.
    • Snowflake URL: The URL of your Snowflake instance in the format user:password@<snowflakeAccount>/$DB_NAME/$SCHEMA?warehouse=$WAREHOUSE. For example, satoriuser:password@<snowflakeAccount>/SATORIDB/PUBLIC?warehouse=COMPUTE_WH.
      • Snowflake query parameters can optionally be provided as well.
  2. Click Save to save the configuration.

The Snowflake connection is now configured and will be tested by inserting a dummy event into the specified table. If the test is successful, the connection status will be displayed as Active.