Sections in this category

Connecting to Snowflake

  • Updated

Sisu allows you to connect to your data in Snowflake.

 

Related Articles:

info_icon.png

To connect to Snowflake, Sisu requires a minimum level of permissions. This is accomplished through the creation of Roles and Users within the Snowflake UI or SnowSQL. In order to follow these steps, the account being used to create this user/role combination must have access to the following roles:

  • SYSADMIN
  • SECURITYADMIN
  • USERADMIN

 

Step 1:  Determine Database, Schema and Tables

Sisu accesses the data stored within Snowflake to run analysis. To ensure Sisu only has access to the correct data, it is recommended to limit the access to the appropriate database, schema, or specific tables that will be used by Sisu. 

This access is controlled in Snowflake. To learn more, please refer to the Snowflake Role Based Access documentation.

 

Step 2:  Create Sisu Role, User, and Warehouse

Sisu recommends creating a role that has access to a single database where the appropriate data has been stored. 

The below query creates the appropriate role, user, and warehouse for Sisu to use. If schema, not database, level access is preferred, include the commented out sections that reference schema.

You can also use the Snowflake web UI to create the role, user, and warehouse.

begin;


set role_name ='SISU_ROLE'

set user_name = 'SISU_USER'

set user_password = 'please_replace_with_password'

set warehouse_name = 'SISU_WAREHOUSE'

set database_name = 'DATABASE_NAME'

set schema_name = 'SCHEMA_NAME'


-- Create role for Sisu

use role securityadmin;

create role if not exists identifier($role_name);

comment on identifier($role_name) is 'This role is used by Sisu to perform analysis';

grant role identifier($role_name) to role SYSADMIN;


-- Create warehouse for Sisu

use role sysadmin;

create warehouse if not exists identifier($warehouse_name)

warehouse_size = xsmall

warehouse_type = standard

auto_suspend = 60

auto_resume = true

initially_suspended = true;


-- Create user for Sisu

use role useradmin;

create user if not exists identifier($user_name)

password = $user_password

default_role = $role_name

default_warehouse = $warehouse_name


-- Grant Sisu user access to role and warehouse

use role securityadmin;

grant role identifier($role_name) to user identifier($user_name);

grant usage on warehouse identifier($warehouse_name) to role identifier($role_name)


-- Grant Sisu role access to database and all future schema/tables

grant usage on database identifier($database_name) to role identifier($role_name);

grant usage on all schemas in database MY_DB to role TEST_ROLE;

grant select on all tables in database MY_DB to role TEST_ROLE;


grant usage on future schemas in database identifier($database_name)

   to role identifier($role_name);

grant select on future tables in database identifier($database_name)

   to role identifier($role_name);


-- If using Schema based access instead of Database

grant usage on database identifier($database_name) to role identifier($role_name);

grant usage on schema identifier($schema_name) to role identifier($role_name);

grant create stage on schema identifier($schema_name) to role identifier($role_name);

grant select on future tables in schema identifier($schema_name) to role identifier($role_name)


commit;

 

Step 3:  Add Snowflake Data Source in Sisu

To add Snowflake as a Data Source in Sisu:

  1. In the main Sisu menu at the top of the screen, click Data sources page, then click "+ New data source". 
    Data_tab_-_New_data_source.png

  2. Select “Snowflake” from the Select data source dropdown, and fill in the following information as described below.

    Hostname

    This can be found in the link of the browser.
    Ex: <host>.snowflakecomputing.com

    Database Name

    The database name defined in the query.

    Warehouse

    The warehouse name defined in the query.

    Role

    The role name defined in the query.

    Staging schema

    The schema name defined in the query.

    Username

    The username defined in the query.

    Password

    The password defined in the query.

    Display Name

    How the source will be displayed in Sisu.

    Restrict access

    Use this option to select the Roles that can access this data.


    Add_Snowflake.png

    tip_icon_-_small.png Check Restrict Access if you want to restrict this data source to specific users.


  3. Click Add.

    info_icon.png If you experience any issues, please contact Sisu at support@sisudata.com.