Configuration/Setup of Snowflake

Written by Julie Trenque

Updated on 01/17/2024

1 min

Advanced

Manage your integrations

Analytics

Automation

CDP

CMP

CMS/CRM

Data Warehouses

Developers

Was this content useful?

To configure this integration, you need to create a Snowflake user and an associated role with specific rights in your Snowflake account that Kameleoon will then use to interact with your warehouse. This tutorial will walk you through the commands you can execute in a Snowflake worksheet in your Snowflake user interface to provide Kameleoon with the required credentials.

First, start by creating a Snowflake user with a secure password, and a role that you grant to this user. In the examples, the user and role are called KAMELEOON_USER and KAMELEOON_ROLE. You can use other names, you will provide these names later on when setting up the integration in the Kameleoon interface. Be sure to replace MySecurePassword with a highly secure password and MY_WAREHOUSE by the name of your Snowflake warehouse.

CREATE ROLE KAMELEOON_ROLE;
CREATE USER KAMELEOON_USER PASSWORD='MySecurePassword';
GRANT ROLE KAMELEOON_ROLE TO USER KAMELEOON_USER;
GRANT USAGE ON WAREHOUSE MY_WAREHOUSE TO ROLE KAMELEOON_ROLE;

Kameleoon will only need read permissions on your data, as we will see further down. However, Kameleoon requires that you create a dataset called KAMELEOON containing two schemas KAMELEOON_CONFIGURATION and KAMELEOON_EVENTS on which Kameleoon needs write access. You can achieve this with the following commands:

CREATE DATABASE KAMELEOON;
CREATE SCHEMA KAMELEOON.KAMELEOON_CONFIGURATION;
CREATE SCHEMA KAMELEOON.KAMELEOON_EVENTS;
GRANT USAGE ON DATABASE KAMELEOON TO ROLE KAMELEOON_ROLE;
GRANT USAGE ON ALL SCHEMAS IN DATABASE KAMELEOON TO ROLE KAMELEOON_ROLE;
GRANT CREATE TABLE ON ALL SCHEMAS IN DATABASE KAMELEOON TO ROLE KAMELEOON_ROLE;

Now you just need to give read access to your data to the Kameleoon user. For example, if you have a schema called MY_AUDIENCES, containing tables you wish to poll audiences from, contained in a database called MY_DATA. Then you can configure read access to the Kameleoon user with these commands:

GRANT USAGE ON DATABASE MY_DATA TO ROLE KAMELEOON_ROLE;
GRANT USAGE ON SCHEMA MY_DATA.MY_AUDIENCES TO ROLE KAMELEOON_ROLE;
GRANT SELECT ON ALL TABLES IN SCHEMA  MY_DATA.MY_AUDIENCES TO ROLE KAMELEOON_ROLE;

The setup is now complete. You can activate the Snowflake audience in the Kameleoon interface. To set up the connection for a given Kameleoon project, you will be prompted to provide the names of the Snowflake user and role you have just created, as well as the password you assigned to that user.