Skip to main content

Connect Snowflake

Allow secure access in your Snowflake account, then connect in AgencyAnalytics to start query your warehouse and display that data on dashboards and reports.

Written by Tatum Savage
Updated yesterday

Snowflake is a cloud-based data warehouse that lets you store, query, and analyze large volumes of data. After purchasing the database connector add-on, connect Snowflake to query your warehouse directly from widgets on your AgencyAnalytics dashboards and reports.

Click here to read more about the database connector add-on and how to use database integration widgets.

Prerequisites

Before connecting Snowflake to AgencyAnalytics, you’ll need to complete a few steps in your Snowflake account to allow secure access. Make sure you have admin-level access to your Snowflake account, or work with your Snowflake administrator to complete these steps.

You’ll need:

  • A Snowflake account with ACCOUNTADMIN or SECURITYADMIN role access

  • The ability to create network rules and network policies

  • Permission to generate a programmatic access token (PAT)

1. Create a Network Rule

To allow AgencyAnalytics to connect to your Snowflake warehouse, you’ll first need to create a network rule that whitelists the AgencyAnalytics IP addresses.

1. Sign in to Snowsight using a role with ACCOUNTADMIN or SECURITYADMIN privileges.

2. In the left navigation, go to Admin > Security.

3. Open the Network Rules tab.

4. Click + Network Rule.

5. Enter a name for the rule (e.g. agencyanalytics_network_rule).

6. Select the schema where the network rule will be stored.

7. Set Type to IPv4.

8. Set Mode to Ingress.

9. Under Identifiers, add each of the following AgencyAnalytics IP addresses:

34.139.49.237

34.23.136.27

34.139.66.246

34.148.57.44

35.196.154.58

34.148.207.61

Tip: You may need to add each IP individually depending on your Snowflake interface. Make sure all 6 IPs are added.

10. Click Create Network Rule to save.

Alternative: Using SQL

If you prefer to use SQL, open a Snowflake worksheet and run:

CREATE NETWORK RULE agencyanalytics_network_rule

MODE = INGRESS

TYPE = IPV4

VALUE_LIST = (

'34.139.49.237’,

‘34.23.136.27’,

‘34.139.66.246’,

‘34.148.57.44’,

‘35.196.154.58’,

34.148.207.61’,

);

2. Create a Network Policy

Next, create a network policy that references the network rule you just created. This policy enforces IP-based access control on your Snowflake account.

1. In Snowsight, go to Admin > Security.

2. Open the Network Policies tab.

3. Click + Network Policy.

4. Enter a name for the policy (e.g. agencyanalytics_network_policy).

5. Under Allowed, click Select rule, then choose the network rule you created in Step 1.

6. Click Create Network Policy to save.

Alternative: Using SQL

CREATE NETWORK POLICY agencyanalytics_network_policy

ALLOWED_NETWORK_RULE_LIST = ('agencyanalytics_network_rule');

3. Activate the Network Policy

After creating the network policy, you need to activate it so it takes effect.

1. In Snowsight, go to Admin > Security.

2. Open the Network Policies tab.

3. Find the policy you created in Step 2.

4. Click the … (More) menu next to the policy.

5. Select Activate On Account.

6. Click Activate policy to confirm.

Important: If you already have a network policy active on your account, you’ll need to add the AgencyAnalytics IPs to your existing policy rather than creating a new one. Activating a second account-level policy will override the first. In that case, edit your existing network rule to include the AgencyAnalytics IP addresses, or create a new rule and add it to your existing policy.

Alternative: Using SQL

Option A: Apply to the entire account

ALTER ACCOUNT SET NETWORK_POLICY = agencyanalytics_network_policy;

Option B: Apply to a specific user only

ALTER USER your_username SET NETWORK_POLICY = agencyanalytics_network_policy;

4. Generate a Programmatic Access Token (PAT)

AgencyAnalytics uses a programmatic access token (PAT) to authenticate with your Snowflake account. This is more secure than using a password and gives you more control over access.

1. In Snowsight, go to Admin > Users & Roles.

2. Select the user you want to generate the token for.

3. Scroll to the Programmatic access tokens section.

4. Click Generate new token.

5. Fill in the following:

  • Name: Enter a name for the token (e.g. agencyanalytics_pat). Only letters, numbers, and underscores are allowed.

  • Comment (optional): Add a description like “Token for AgencyAnalytics connection.”

  • Expires in: Choose how many days the token should remain valid.

  • Role (recommended): Select One specific role and choose the role that has access to the databases/schemas you want to query.

6. Click Create Token.

7. Copy the token immediately and store it securely. It will not be shown again.

Important: Make sure the user you generate the PAT for has the necessary permissions to query the databases and schemas you want to connect. At minimum, the user needs USAGE on the warehouse, USAGE on the database and schema, and SELECT on the tables or views.

Alternative: Using SQL

ALTER USER your_username SET ENABLE_PROGRAMMATIC_ACCESS = TRUE;

Then generate the token:

SELECT SYSTEM$GENERATE_USER_PROGRAMMATIC_ACCESS_TOKEN('your_username');

Copy the token and store it securely. This token is only shown once.

5. Connect Snowflake in AgencyAnalytics

Now that your Snowflake account is configured, you can connect it to AgencyAnalytics.

1. Open the Client where you’d like to connect Snowflake, then click the Data Sources tab at the top.

2. Click the blue Connect Data Source button in the upper right corner.

3. Search for Snowflake in the search bar, then click the Snowflake card.

4. Enter the following connection details:

Field

Description

Account Identifier

Your Snowflake account identifier (e.g. xy12345.us-east-1). Found in your Snowflake account URL.

User

The Snowflake username associated with the PAT you generated.

Programmatic Access Token

The PAT you generated in Step 4. Paste it here.

Warehouse

The Snowflake warehouse to run queries against (e.g. COMPUTE_WH).

Database.Schema

The database and schema to query, in the format DATABASE.SCHEMA (e.g. MARKETING_DB.PUBLIC).

Role (optional)

The Snowflake role to use for the connection. This determines what data you can access.

5. Click Connect to save the integration.

Once saved, Snowflake will be successfully connected. You can start adding Snowflake widgets to your reporting and query data right away.


Querying Data from Snowflake

After connecting Snowflake, you can pull data into your dashboards and reports using the database connector widgets.

Select columns from your schema

When adding a new database widget, you’ll be able to browse your connected database and schema, then select the specific columns you want to display. This is the quickest way to pull in data without writing any SQL.

Write a custom SQL query

For more advanced use cases, you can write a custom SQL query directly in the widget editor. This gives you full control over joins, filters, aggregations, and any transformations you need.

AgencyAnalytics uses the same SQL syntax as Snowflake, so any query that works in your Snowflake worksheet will work here.


❓ FAQ

Why is a programmatic access token (PAT) required?

PATs provide a more secure authentication method than passwords. They can be scoped to specific users and revoked at any time without changing the user’s password.

Can I connect multiple Snowflake warehouses?

Yes. You can add multiple Snowflake connections to the same Client or across different Clients. Each connection can point to a different warehouse, database, or schema.

What permissions does the Snowflake user need?

The user associated with the PAT needs at minimum:

  • USAGE permission on the warehouse

  • USAGE permission on the database and schema

  • SELECT permission on the tables or views you want to query

What happens if my PAT expires or is revoked?

If your PAT is no longer valid, the Snowflake connection in AgencyAnalytics will stop syncing data. You’ll need to generate a new PAT in Snowflake and update the connection details in AgencyAnalytics.

Do I need to whitelist an IP address?

Yes. Snowflake requires a network rule and network policy to allow connections from AgencyAnalytics. Follow Steps 1–3 above to set this up.

💬 Need additional help?

If you have any questions, please contact our friendly support team by following these instructions! We’re available 24/5 to help.

Did this answer your question?