Configuration/Setup of Snowflake

Written by Julie Trenque

Updated on 05/28/2024

5 min

Advanced

Manage your integrations

Analytics

Automation

CDP

CMP

CMS/CRM

Data Warehouses

Developers

Was this content useful?

To configure this integration, you will need your snowflake account identifier. You will also 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 and how  to provide Kameleoon with the required credentials.

Kameleoon UI

To create a connection with your Snowflake warehouse you first need to fill the following UI fields.

The following sections will explain each field and show you how you can configure them in your Snowflake account.

Snowflake identifier

It is the string identifier described in the Snowflake documentation. On our back end this string will be inserted into the full URL to access your account : https://<account_identifier>.snowflake-computing.com
Only enter the substring account_identifier not the full URL.

Creating a Snowflake user

Password authentication

The Snowflake integration supports two authentication methods. The first is password authentication. To achieve this you can use the following commands in your Snowflake UI to create a Snowflake user (called KAMELEOON_USER in this example) with a highly secure password:

CREATE USER KAMELEOON_USER PASSWORD='MySecurePassword';

In the UI you can then provide this password when setting up the integration.

Note: If you wish to use Snowflake as a destination you MUST NOT choose this authentication method, only the “key pair” method described in the next section will work.

Key-Pair authentication

The second authentication method is via RSA key-pair (which consists of an RSA private key and an RSA public key). Kameleoon will generate this key pair on our back end and provide you with the public key (the private key is stored on our servers to be used by our application when querying your warehouse).

Once you click Confirm, the public key is displayed in the Kameleoon UI with the command you can use to assign this public key to the user you create. Please copy this public key as it will not be displayed again. If you do lose the public key you can just erase the connection and configure it again, thus generating a new key pair.

Note: If you wish to use Snowflake as a destination you MUST choose this authentication method and not “password”.

Snowflake role

Creation

Here are the commands to create a Snowflake role (called KAMELEOON_ROLE in this example, but again you can use your internal naming practices) and assign it to our user KAMELEOON_USER:

CREATE ROLE KAMELEOON_ROLE;

GRANT ROLE KAMELEOON_ROLE TO USER KAMELEOON_USER;

Granting permissions

You have to first grant access to your warehouse (here called MY_WAREHOUSE)

GRANT USAGE ON WAREHOUSE MY_WAREHOUSE TO ROLE KAMELEOON_ROLE;

Kameleoon will need a specific database called KAMELEOON (please use this name) with read and write access permissions to this database

CREATE DATABASE KAMELEOON;

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;

  • If you plan on using Snowflake as a source

If you plan on using Snowflake as a source, you need to create a schema called KAMELEOON_CONFIGURATION (please use this name) and grant rights on this schema:

CREATE SCHEMA KAMELEOON.KAMELEOON_CONFIGURATION;

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;

  • If you plan on using Snowflake as a destination

If you plan on using Snowflake as a destination you need to create a schema called KAMELEOON_EVENTS (please use this name) to store the Kameleoon exposure events table:

CREATE SCHEMA KAMELEOON.KAMELEOON_EVENTS;

The setup is now complete. You can now activate Snowflake as a source and/or as a destination.

  • In this article :