Skip to main content
Authentication Method: Margin uses RSA key pair authentication to connect to Snowflake. You’ll generate an RSA private key (.p8 file) and configure the public key on your Snowflake user.If you encrypt your private key with a passphrase, you’ll need to enter it in Margin during setup.

1. Snowflake Credential Setup

Margin needs a dedicated Snowflake user with:
  • scoped read access to the specific source schemas/tables you approve
  • permission to create and manage schemas in a dedicated Margin database
If you use an existing user, make sure it has both sets of privileges.

How Margin Integrates

Margin does not write into your existing source schemas. Everything Margin produces lives in schemas created under your dedicated Margin database.

Create a Snowflake User

Below is a step-by-step guide to set up a Snowflake user with the necessary permissions:
Generate RSA Key PairRun these commands in your terminal to generate your private key and public key:
If you set a passphrase, remember it. You will need to enter it in Margin.
Locations to fill in required fields are highlighted in green
Copy and paste for each table you want Margin to read:
Configure the columns you want to mask in specific tables.
  • Recommended: Use Option 1: built-in masking policies if you have Snowflake Enterprise.
  • Otherwise, Option 2: secure views lets you expose a restricted projection.
Margin creates and manages its own schemas inside your dedicated Margin database.
This grants control only where explicitly allowed. MARGIN_USER cannot create users/roles or access objects that are not granted to MARGIN_ROLE.
If you need to connect to multiple databases, reach out to [email protected], we can enable this for you.

2. Snowflake Connection Configuration

A. Add a Snowflake Source in Margin

Go to your Integrations page in the Margin dashboard & click Add Source and select Snowflake.
Connect to Snowflake

B.Enter Snowflake Credentials

Enter the following required fields into Margin:
Snowflake accounts can have different identifier formats depending on when they were created. For example, older accounts might look like ACCOUNT_LOCATOR.CLOUD_REGION_ID.CLOUD, while newer ones may look like ORGNAME-ACCOUNT_NAME. Check Snowflake’s documentation if unsure.

3. Testing the Connection

When you set up Snowflake, Margin verifies:
  1. Basic connectivity check: Network connection & credential validation
  2. Verify user can create/manage schemas and objects in the dedicated Margin database:
    • Schema lifecycle (CREATE, ALTER, DROP)
    • Table lifecycle (CREATE, INSERT, SELECT, UPDATE, DELETE, RENAME, DROP)
    • View lifecycle (CREATE, RENAME, DROP)
    • Create/Drop STAGE
    • Create/Drop FILE FORMAT
Sometimes the initial test might time out, especially if Snowflake is resuming from a suspended state. Simply click Test again to retry. Once a connection is established, further requests usually run quickly.

Troubleshooting

Authentication failures

  • Ensure you’re using an RSA private key (.p8 file), not an SSH key
  • Verify the public key is set on your Snowflake user: DESC USER MARGIN_USER
  • If you used a passphrase when generating the key, enter it in Margin

Permission errors during testing

  • The wizard shows exactly which permissions are missing
  • Ensure you completed Step 2 (dedicated Margin database permissions), Step 3 (schema USAGE), and Step 4 (table SELECT grants) in the setup script

Connection timeout

  • Snowflake warehouses may be suspended—click “Test” again to retry
  • Check that your account identifier format is correct

Next Steps

Once the connection is established, you can connect your finance sources to model over your event data.

Sources: Finance Data

Connect your finance data sources