Snowflake Data Source

Get Snowflake Account Information

To set up a Cast Datasource for Cast.app to query your Snowflake data, you will need to provide the Snowflake account information. If you are not sure where to find this, follow the steps below:

  1. In your Snowflake UI, navigate to the admin section in the left sidebar.
  2. Go to the account section.
  3. Copy the Snowflake account URL. It will look something like: https://jkgcowj-htb35055.snowflakecomputing.com
  4. From the copied URL, you only need the string jkgcowj-htb35055 which will be used as the account information.

Creating a Snowflake Datasource

Cast connects to your Snowflake database to query data for use in your Cast presentations. You’ll need to provide Cast with credentials to access your Snowflake account.

Cast supports two authentication methods: Username/Password and Key-Pair Authentication.

Note on Snowflake’s Authentication Changes: Snowflake is deprecating password authentication for service users (automated/server connections like Cast). For production use, we recommend using Key-Pair Authentication. Username/Password authentication will be phased out for service accounts by October 2026. Learn more about Snowflake’s MFA requirements.

Method 1: Username and Password (Legacy)

In your Snowflake account:

  1. Create a Snowflake user for Cast (or use an existing user)
  2. Grant appropriate permissions to the user for the databases/schemas Cast needs to query

In Cast.app:

  1. Navigate to the Datasets screen in Cast.app designer by clicking on “Home” at the top of the screen and selecting “Datasets”.
  2. Click on “Add New Dataset”.
  3. Select “Add a Data Source” and choose “Snowflake” in the popup.
  4. On the datasource setup screen, provide:
    • Account Information: Your Snowflake account identifier (e.g., jkgcowj-htb35055)
    • Username: The Snowflake username you created for Cast
    • Password: The password for that user
  5. Provide a descriptive name for your datasource.
  6. Click on “Add Configuration”.

Video Tutorial

Key-pair authentication is more secure and will be required for service connections to Snowflake.

Step 1: Generate Key Pair

Run these commands on your local machine or server:

# Generate private key
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt

# Generate public key
openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub

This creates two files:

  • rsa_key.p8 - Your private key (keep this secure, you’ll provide it to Cast)
  • rsa_key.pub - Your public key (you’ll assign this to your Snowflake user)

Step 2: Configure Your Snowflake Account

  1. Create a service user for Cast in your Snowflake account (or use an existing user)
  2. Run these commands in Snowflake:
-- Assign the public key to your user
ALTER USER <username> SET RSA_PUBLIC_KEY='<PUBLIC_KEY_STRING>';

-- Set the user type to SERVICE (required for non-human access)
ALTER USER <username> SET TYPE = 'SERVICE';

-- Grant necessary permissions
GRANT USAGE ON WAREHOUSE <warehouse_name> TO USER <username>;
GRANT USAGE ON DATABASE <database_name> TO USER <username>;
GRANT USAGE ON SCHEMA <database_name>.<schema_name> TO USER <username>;
GRANT SELECT ON ALL TABLES IN SCHEMA <database_name>.<schema_name> TO USER <username>;

To get the PUBLIC_KEY_STRING, open rsa_key.pub and copy only the content between -----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY----- (excluding those header/footer lines).

Step 3: Provide Credentials to Cast

  1. Navigate to the Datasets screen in Cast.app designer.
  2. Click on “Add New Dataset”.
  3. Select “Add a Data Source” and choose “Snowflake”.
  4. On the datasource setup screen, provide:
    • Account Information: Your Snowflake account identifier (e.g., jkgcowj-htb35055)
    • Username: The Snowflake service user you created for Cast
    • Private Key File: Your private key content (base64-encoded). To encode your rsa_key.p8 file:
      base64 -i rsa_key.p8
      

      Copy the entire output and paste it into this field.

    • Private Key Passphrase (optional): Leave empty if you didn’t encrypt your private key with a passphrase
    • Warehouse: The warehouse name Cast should use
    • Database: The database name Cast should query
  5. Provide a descriptive name for your datasource.
  6. Click on “Add Configuration”.

Security: Keep your private key (rsa_key.p8) secure. Only provide the base64-encoded version to Cast through the datasource configuration. Never share it via email or unsecured channels.

Creating Datasets from Snowflake Datasources

  1. After adding a datasource, locate the Snowflake datasource you just created. If you cannot see it, return to the Datasets screen by following Step 1 and 2 in the section above. “Creating a Snowflake Datasource”.
  2. Click on the Snowflake datasource that you created in the previous step.
  3. Query your Snowflake data, assign a name to the dataset, and save.