> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting up the Snowflake integration

> This topic explains how to set up the Snowflake integration.

> For the complete documentation index, see [llms.txt](/llms.txt). For the full documentation snapshot, see [llms-full.txt](/llms-full.txt).

<Note title="Contact us for help with configuring Snowflake native Experimentation">
  If you have both [Data Export](/integrations/data-export) and [Experimentation](/home/experimentation) enabled for your LaunchDarkly account, you should have access to Snowflake native Experimentation. If you do not have access or need help getting started, contact your LaunchDarkly representative or [start a Support ticket](https://support.launchdarkly.com/hc/en-us/requests/new).
</Note>

<Warning title="Snowflake native Experimentation works only with LaunchDarkly experiment data">
  You can only run Snowflake native experiments with data that was generated from a LaunchDarkly experiment. You cannot run Snowflake native experiments on data from third-party sources, or on LaunchDarkly flag evaluations that were not part of an experiment.
</Warning>

## Overview

This topic explains how to set up the Snowflake native Experimentation integration.

## Prerequisites

To configure the Snowflake integration, you must have the following prerequisites.

### Snowflake data requirements

Before you begin, prepare your Snowflake data to meet the [Snowflake data requirements](/home/warehouse-native/snowflake-requirements) for the integration.

### Role permissions

The role permission requirements include:

* You must have the `ACCOUNTADMIN` role in Snowflake
* You must have a [LaunchDarkly role](/home/account/roles) of Owner or Admin, or a custom role that allows the following actions:
  * [add and edit integrations](/home/account/roles/role-actions#integration-actions)
  * [add destinations](/home/account/roles/role-actions#destination-actions)
  * [add metric data sources](/home/account/roles/role-actions#metric-data-source-actions)

### IP addresses

You must add to your Snowflake allow list the following outbound IP addresses:

<Feature flag="docs-enable-non-commercial-content" fallbackValue={"commercial"} match={"commercial"}>\* `52.21.152.96/32` \* `52.200.35.24/32` \* `52.200.50.23/32` \* `54.144.218.89/32` \* `54.221.221.197/32` \* `34.236.6.43/32`</Feature>

<Feature flag="docs-enable-non-commercial-content" fallbackValue={"commercial"} match={"eu"}>- `3.78.21.121/32` - `3.124.211.237/32` - `18.153.39.243/32` - `3.75.12.2/32` - `3.68.26.17/32` - `3.77.253.41/32`</Feature>

For a full list of LaunchDarkly's public IP addresses, read [Public IP list](/home/infrastructure/ip-list).

### Network policy

* If you use network policies within your Snowflake account, you will need to create or update your policy to allow traffic from LaunchDarkly. To do this, you need your LaunchDarkly project key and environment key:

1. Find, copy, and save your project key [following these instructions](/home/account/project#project-keys).

2. Find, copy, and save your environment key [following these instructions](/home/account/environment/keys#environment-keys).

3. Combine the keys together, separated by two underscores. For example, if your project key is `MobileApp` and your environment key is `production`, your combined key is `MobileApp__production`.

4. Replace `<ProjKey__EnvKey>` with your combined key in the code sample below, and add it to your Snowflake network policy:

<Feature flag="docs-enable-non-commercial-content" fallbackValue={"commercial"} match={"commercial"}>
  <CodeGroup>
    ```sql title="Snowflake network policy" theme={null}
          CREATE NETWORK RULE LD_EXPORT.EXPORT_<ProjKey__EnvKey>.LD_DATA_EXPORT_NETWORK_RULE TYPE = IPV4 MODE = INGRESS VALUE_LIST = ('35.192.85.117');

          CREATE NETWORK POLICY LD_DATA_EXPORT_NETWORK_POLICY
            ALLOWED_NETWORK_RULE_LIST=(LD_DATA_EXPORT_NETWORK_RULE);

          ALTER USER LD_EXPORT_USER_<ProjKey__EnvKey> SET NETWORK_POLICY = LD_DATA_EXPORT_NETWORK_POLICY;
    ```
  </CodeGroup>
</Feature>

<Feature flag="docs-enable-non-commercial-content" fallbackValue={"commercial"} match={"eu"}>
  <CodeGroup>
    ```sql title="Snowflake network policy" theme={null}
          CREATE NETWORK RULE LD_EXPORT.EXPORT_<ProjKey__EnvKey>.LD_DATA_EXPORT_NETWORK_RULE TYPE = IPV4 MODE = INGRESS VALUE_LIST = ('35.241.154.37');

          CREATE NETWORK POLICY LD_DATA_EXPORT_NETWORK_POLICY
            ALLOWED_NETWORK_RULE_LIST=(LD_DATA_EXPORT_NETWORK_RULE);

          ALTER USER LD_EXPORT_USER_<ProjKey__EnvKey> SET NETWORK_POLICY = LD_DATA_EXPORT_NETWORK_POLICY;
    ```
  </CodeGroup>
</Feature>

## Step 1: Gather your Snowflake account information

To begin, collect the following information about your Snowflake account:

* The name of the Snowflake database containing your metrics data. LaunchDarkly will be granted read access to this database.
* The name of the schema within your metrics database. You don't need this if you want to grant access to all schemas within the database.

## Step 2: Configure the Snowflake Data Export integration

<Note title="You must be using the latest version of the Snowflake Data Export integration">
  If you were using an earlier version of Snowflake Data Export, you must update it to the version released in January 2025.
</Note>

To begin, configure the latest Snowflake Data Export integration. The Snowflake Data Export integration provides LaunchDarkly experiment exposure data to Snowflake. This data is used with your metric events data stored in Snowflake to compute experiment results.

Follow the installation instructions at [Snowflake Data Export](/integrations/data-export/snowflake) to configure the Snowflake Data Export integration. You can also view a 6-minute [instructional video about Snowflake Data Export Setup](https://youtu.be/yCW0gAbVZqo).

## Step 3: Configure the Snowflake native Experimentation integration

Now, you will configure the Snowflake native Experimentation integration in LaunchDarkly. This integration looks similar to the Snowflake Data Export integration, but is a separate integration requiring a separate setup process.

To set up the Snowflake native Experimentation integration:

1. Navigate to the [**Integrations**](https://app.launchdarkly.com/settings/integrations) page.
2. Search for and select **Snowflake Native Experimentation**.
3. Click **Add integration**. The [configuration panel](https://app.launchdarkly.com/settings/integrations/snowflake-experimentation/new) appears.
4. Enter an integration **Name**.
5. Select the LaunchDarkly **Project and environment** for this integration. You cannot change this after you save the integration.

<Frame caption="The Snowflake Native Experimentation configuration panel in LaunchDarkly.">
  ![The Snowflake Native Experimentation configuration panel in LaunchDarkly.](https://files.buildwithfern.com/https://launchdarkly.docs.buildwithfern.com/docs/a89ff19b3cd50bf00f8e37c6463f2d923ce5c86a0e7d234531441aa65a762ddb/assets/images/auto/snowflake-native-exp-config.auto.png)
</Frame>

6. Enter your Snowflake **Metrics database name**.
7. (Optional) Enter your Snowflake **Metrics schema name**.
8. LaunchDarkly generates a **SQL** script. Copy and save this script for use in the next step. Keep the configuration screen open, as you will return to it in a later step.

### Run the SQL script in Snowflake

Next, run the SQL script in Snowflake:

1. In Snowflake, navigate to **Projects / Worksheets**.
2. Click the + "Create SQL worksheet" button to create a new worksheet.
3. Paste the generated script to the worksheet.
4. Click the **arrow** to run the worksheet.

### Save the configuration in Launch

DarklyTo finish the configuration in LaunchDarkly:

1. Return to the LaunchDarkly configuration screen.
2. Click **Test connection and save**.

## Step 4: Create a metric data source

Now, you can set up your metric data source in LaunchDarkly by following the steps under [Create data sources](/home/warehouse-native/metric-data-sources#create-data-sources).

## Step 5: Verify the connection

Finally, verify the connection. Successful connections show a green checkmark and display a "This connection is healthy" status.

## Next steps

Read the following topics to understand how to create an experiment using a Snowflake native metric and how to analyze the experiment results:

* [Creating experiments using warehouse native metrics](/home/warehouse-native/creating)
* [Analyzing experiments](/home/experimentation/analyze)The results page for an experiment using warehouse native metrics displays the date and time the results were last updated from Snowflake. The initial load of experiment results can take up to 60 minutes to appear, and further results updates appear within 15–30 minutes.
