Skip to main content

Set up Snowflake with Ascend

Overview

In this quickstart guide, you'll learn how to use Snowflake as your Data Plane in Ascend.

This guide will take you through the following steps:

Prerequisites

  • Ascend Instance
  • Snowflake account
    • Ability to create Snowflake resources (may require elevated permissions for some steps)
  • Snowflake user with both SYSADMIN and SECURITYADMIN roles to run the setup script
  • Familiarity with the role of the Data Plane in Ascend
Snowflake Security Requirements

Snowflake has implemented enhanced security measures that affect user authentication:

  • Human users must use Multi-Factor Authentication (MFA) when authenticating with passwords
  • Service users (non-human users like Ascend service accounts) must use key-pair authentication instead of passwords

For more details, see Snowflake's MFA rollout documentation.

Generate RSA Key Pair

Run the following commands in your terminal:

macOS-specific commands

This quickstart uses macOS-specific commands like pbcopy for copying text to the clipboard. If you're using a different operating system, adjust the commands accordingly:

  • Windows: Use clip instead of pbcopy
  • Linux: Use xclip -selection clipboard or xsel --clipboard --input instead of pbcopy
# 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

# Copy the public key
cat rsa_key.pub | pbcopy

Create Snowflake resources

Snowflake Projects & Resource Isolation

Ascend recommends creating dedicated Snowflake resources for your Ascend workloads to ensure proper resource isolation. However, if you cannot create new resources or prefer to use an existing one, you can skip this step.

Additionally, this quickstart grants elevated permissions for the sake of simplicity.

The following script creates a Snowflake service user (via key-pair authentication), warehouse, database, schema, and role. These resources correspond to the existing Ascend Production Environment that comes with your trial Instance.

Run the following in Snowflake:

tip

Replace <PASTE_YOUR_PUBLIC_KEY_HERE> in the SQL code below with the RSA public key you generated in the previous step.

USE ROLE SYSADMIN;
SET ENV_PROD_DB='ASCEND_ENV_PROD';
SET WAREHOUSE='ASCEND_ENV_PROD';
CREATE DATABASE identifier($ENV_PROD_DB);
CREATE WAREHOUSE identifier($WAREHOUSE) WAREHOUSE_SIZE='XSMALL' WAREHOUSE_TYPE='STANDARD' AUTO_SUSPEND=60 AUTO_RESUME=TRUE INITIALLY_SUSPENDED=TRUE;

USE ROLE SECURITYADMIN;
SET ENV_PROD_USER='ASCEND_ENV_PROD';
SET ENV_PROD_ROLE='ASCEND_ENV_PROD';
CREATE ROLE identifier($ENV_PROD_ROLE);

-- Create service user with key-pair authentication
CREATE USER identifier($ENV_PROD_USER)
TYPE=SERVICE
DEFAULT_ROLE=$ENV_PROD_ROLE
RSA_PUBLIC_KEY='<PASTE_YOUR_PUBLIC_KEY_HERE>';

/* Copy the contents of rsa_key.pub (without the BEGIN/END lines)
and paste as the RSA_PUBLIC_KEY value above */

GRANT ROLE identifier($ENV_PROD_ROLE) TO USER identifier($ENV_PROD_USER);
GRANT ALL ON WAREHOUSE identifier($WAREHOUSE) TO ROLE identifier($ENV_PROD_ROLE);
GRANT ALL ON DATABASE identifier($ENV_PROD_DB) TO ROLE identifier($ENV_PROD_ROLE);

Store your Snowflake private key

Store your Snowflake private key as an Environment Vault secret to securely configure your Snowflake Data Plane:

  1. Run this command in your terminal to copy your Snowflake private key (including the BEGIN/END lines):
    cat rsa_key.p8 | pbcopy
  2. In your Ascend Instance, click on your profile picture in the top-right corner and select Settings
  3. Navigate to the Secrets & Vaults section
  4. Select the Default Environment Vault
  5. Click Add secret
  6. Name your secret SNOWFLAKE_PRIVATE_KEY and paste the key in the Value field
  7. Click Create to store your secret

Configure your Workspace & Project

note

Alternatively, you can keep the out-of-the-box Project configuration and create a new Snowflake Data Plane Connection instead. This allows you to use the existing setup and proceed directly to running the sales Flow.

Configure your Default Ascend Project to use the Snowflake-specific template:

  1. Navigate to the Projects & Deployments section of your settings

  2. Select the Default Project

  3. Change the Project root to projects/default/snowflake

  4. Click Save to apply your changes

  5. Navigate back to your Ascend Workspace via the homepage or with Cmd+K search navigation

  6. Open the Files panel and locate ascend_project.yaml toward the bottom of the file tree.

  7. Set your Snowflake account along with parameters corresponding to the resources we created above:

    snowflake:
    account: <YOUR_SNOWFLAKE-ACCOUNT> (the Snowflake account you used to create resources above)
    user: ASCEND_ENV_PROD
    role: ASCEND_ENV_PROD
    warehouse: ASCEND_ENV_PROD
    database: ASCEND_ENV_PROD
    max_concurrent_queries: 20
  8. Use Cmd + S / Ctrl + S to save your ascend_project.yaml.

note

If you customized the resource names in the Snowflake setup script above, make sure these values match what you created.

Legacy profiles

If you encounter a build error related to a legacy profile, expand the section below for instructions.

Update legacy profile to use private key authentication

Your profile may contain the password field instead of the private_key field.

To fix this:

  1. Navigate to the data_plane_snowflake Connection configuration file in the build panel, Files panel, or using Cmd+K search

  2. Replace the password field with:

    private_key: ${vaults.environment.SNOWFLAKE_PRIVATE_KEY}
  3. Test the Connection to verify authentication is successful

Run the sales Flow

  1. In the Super Graph view of your Ascend Workspace, double-click the sales Flow to open the Flow Graph view, which shows all Components in the sales Flow
  2. In the build info panel on the top left, click Run Flow and watch all Components in your Flow execute from left to right

View Ascend tables in Snowflake

  1. Right-click on the read_sales_website Component (or any Component) in the Flow Graph
  2. Select Records to view the data in the table created by this Component
  3. Click open in Snowflake in the top left of the popup tab folder
  4. View your data in the Snowflake console
note

If you're logged in with a personal Snowflake account, you may need to grant yourself access to view the data.

Grant personal access
GRANT ROLE ASCEND_ENV_PROD TO USER <YOUR-USER-NAME>;

This demonstrates Data Plane persistence in action! With this setup, you can push your compute and storage down to the Snowflake Data Plane for efficient data processing.

🎉 Congratulations! You've successfully configured Snowflake as your Data Plane and run your first Flow!

Next steps

👩🏻‍💻 Follow the developer quickstart to build your own Flow in Ascend