Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
---
title: "Snowflake sync"
sidebarTitle: "Snowflake"
description: "Learn how to configure a Snowflake sync for Infisical."
---
import CreateUserAndToken from "/snippets/app-connections/snowflake/create-user-and-token.mdx";
import ConnectionFormFields from "/snippets/app-connections/snowflake/form-fields.mdx";
A Snowflake Secret Sync pushes secrets from Infisical into a Snowflake schema, where your functions and procedures can reference them as [Snowflake secrets](https://docs.snowflake.com/en/sql-reference/sql/create-secret). Each Infisical secret becomes a `GENERIC_STRING` secret in the schema, with the same name unless you customize key names to add a prefix or suffix.
<Note>
The Snowflake Secret Sync requires a [Snowflake app connection](/integrations/app-connections/snowflake). This guide walks you through creating a project-scoped app connection.
</Note>
## Prerequisites
- A [project with secrets configured](/documentation/platform/secrets-mgmt/quick-starts/deliver-first-secret)
- A [Snowflake account](https://app.snowflake.com/) where you can create users, roles, and network policies, such as with the `ACCOUNTADMIN` role
- A Snowflake [database](https://docs.snowflake.com/en/sql-reference/sql/create-database) and [schema](https://docs.snowflake.com/en/sql-reference/sql/create-schema) for the synced secrets
## Step 1: Create a Snowflake user and programmatic access token
Infisical needs a Snowflake user with a programmatic access token, a network policy, and a role that can create and own secrets in the schema. When you grant privileges, use the statements in the **Secret syncs** tab.
<CreateUserAndToken />
## Step 2: Set up the sync in Infisical
<Tip>
To create the sync using the API, use the [Create Snowflake Sync](/api-reference/endpoints/secret-syncs/snowflake/create) endpoint.
</Tip>
<Steps>
<Step>
In your project, go to **Integrations** and open the **Secret Syncs** tab. Select **+ Add Sync**.

Then, select the **Snowflake** sync.

</Step>
<Step>
Under **Source**, choose which secrets to sync from Infisical:
- **Environment**: The project environment to retrieve secrets from
- **Secret Path**: The folder path to retrieve secrets from
- **Include secrets from all subfolders**: When enabled, also syncs secrets from every folder under the secret path (secret names must be unique across those folders)
<Tip>
If you need to sync secrets from multiple folder locations, use [secret imports](/documentation/platform/secret-reference#secret-imports).
</Tip>

Then select **Continue**.
</Step>
<Step>
Under **Destination**, create or select the Snowflake app connection the sync will use, then choose where secrets go in Snowflake.
<Tabs>
<Tab title="Create a new app connection">
Under **Snowflake Connection**, select **Create Connection** in the dropdown, then fill in:
<ConnectionFormFields />
Select **Connect to Snowflake**. Infisical returns you to the sync form with the new connection selected.
<Note>
This creates a connection scoped to the current project. To share the connection across other projects, [create it at the organization level](/integrations/app-connections/snowflake#step-2-create-the-app-connection) first, then select it here.
</Note>
</Tab>
<Tab title="Use an existing connection">
Under **Snowflake Connection**, select the app connection you'd like to use.
</Tab>
</Tabs>
- **Database**: The Snowflake database that contains the schema
- **Schema**: The schema the sync writes secrets to
Before the sync writes any secrets, Infisical checks that the database and schema exist and that the connection's role can access them. If either check fails, the sync fails without writing anything.

Then select **Continue**.
</Step>
<Step>
Under **Initial Sync Behavior**, select **Overwrite Snowflake**, then select **Continue**.
<Note>
Snowflake doesn't return a secret's value after the secret is created, so this sync can't import existing Snowflake secrets into Infisical. **Overwrite Snowflake** is the only option.
</Note>
</Step>
<Step>
Under **Sync Options**, choose how secrets are synced:
- **Prevent secret deletion**: When enabled, Infisical adds and updates secrets in Snowflake but never deletes them; enable this if you manage some Snowflake secrets outside of Infisical
- **Auto-sync on changes**: When enabled, secrets sync to Snowflake automatically as the source changes; turn it off to sync manually only
- **Customize key names**: Adds a prefix or suffix to every synced name, using `{{secretKey}}` for the original name and `{{environment}}` for the environment slug
<Warning>
A Snowflake schema can hold secrets that other tools created, so a sync can change secrets that were created outside Infisical. If you don't customize key names, the sync treats every secret in the schema that its role owns as one it manages:
- If a Snowflake secret has the same name as an Infisical secret, the sync overwrites the Snowflake secret's value
- If **Prevent secret deletion** is off, every Snowflake secret that isn't in Infisical is deleted
With customized key names, the sync writes only names with your prefix or suffix, and deletes only Snowflake secrets whose names match it.
Before the first sync, customize key names or keep **Prevent secret deletion** on. **Prevent secret deletion** is on by default when you create the sync in the UI, but off unless you set `disableSecretDeletion` when you create it through the API.
</Warning>

Then select **Continue**.
</Step>
<Step>
Give the sync a **Name** and an optional **Description**. The name must be slug-friendly.

Then select **Continue**.
</Step>
<Step>
Review your Snowflake Sync configuration, then select **Create Sync**.

<Check>
The sync is created. If **Auto-sync on changes** is enabled, it begins syncing secrets to the schema right away.
</Check>
</Step>
</Steps>
## Next steps
<CardGroup cols={2}>
<Card title="Secret syncs overview" icon="refresh-cw" href="/integrations/secret-syncs/overview">
Learn how syncs run, how key schemas work, and how to sync subfolders.
</Card>
<Card title="Snowflake user key pair rotation" icon="key" href="/documentation/platform/secret-rotation/snowflake-user-key-pair">
Rotate the RSA key pair of a Snowflake user with the same app connection.
</Card>
</CardGroup>