Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

6.2 KB
Raw Blame
---
title: "Databricks sync"
sidebarTitle: "Databricks"
description: "Learn how to configure a Databricks Sync for Infisical."
---

import ConfigureServicePrincipal from "/snippets/app-connections/databricks/configure-service-principal.mdx";
import ConnectionFormFields from "/snippets/app-connections/databricks/form-fields.mdx";

A Databricks Secret Sync pushes secrets from Infisical into a [Databricks secret scope](https://docs.databricks.com/en/security/secrets/secret-scopes.html) that jobs and notebooks in the workspace can read.

<Note>
    The Databricks Secret Sync requires a [Databricks app connection](/integrations/app-connections/databricks). 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 Databricks secret scope you want secrets synced into. If you don't have one yet, [create a scope](https://docs.databricks.com/en/security/secrets/secret-scopes.html) in your workspace first.

## Step 1: Set up in Databricks

Create a service principal Infisical can use to reach the workspace.

<ConfigureServicePrincipal />

## Step 2: Set up the sync in Infisical

<Tip>
    To create the sync using the API, use the [Create Databricks Sync](/api-reference/endpoints/secret-syncs/databricks/create) endpoint.
</Tip>

<Steps>
    <Step title="Add the sync" titleSize="h3">
        In your project, go to **Integrations** and open the **Secret Syncs** tab. Select **+ Add Sync**.

        ![Secret Syncs Tab](/images/secret-syncs/general/secret-sync-tab.png)

        Then, select the **Databricks** sync.

        ![Select Databricks](/images/secret-syncs/databricks/select-databricks-option.png)
    </Step>
    <Step title="Configure the source" titleSize="h3">
        Configure the **Source** to specify which secrets to sync from Infisical.

        ![Configure Source](/images/secret-syncs/databricks/databricks-source.png)

        - **Environment**: The project environment to retrieve secrets from.
        - **Secret Path**: The folder path to retrieve secrets from.

        <Tip>
            If you need to sync secrets from multiple folder locations, check out [secret imports](/documentation/platform/secret-reference#secret-imports).
        </Tip>

        Then select **Next** to configure the sync's destination.
    </Step>
    <Step title="Configure the app connection" titleSize="h3">
        Create or select the Databricks app connection the sync will use.

        <Tabs>
            <Tab title="Create a new app connection">
                Under **Databricks Connection**, select **Create Connection** in the dropdown, then choose **Databricks Connection**. Select the **Service Principal** method, then fill in:

                <ConnectionFormFields />

                ![Connect via Databricks service principal](/images/secret-syncs/databricks/configure-connection.png)

                Select **Connect to Databricks**. 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/databricks#step-2-create-the-app-connection) first, then select it here.
                </Note>
            </Tab>
            <Tab title="Use an existing connection">
                Under **Databricks Connection**, select the app connection you'd like to use.
            </Tab>
        </Tabs>
    </Step>
    <Step title="Configure the target scope" titleSize="h3">
        Configure the Databricks secret scope where secrets should be deployed.

        ![Configure Destination](/images/secret-syncs/databricks/databricks-destination.png)

        - **Scope**: The Databricks secret scope to sync secrets to.

        <Note>
            Ensure your service principal has [Write permissions](https://docs.databricks.com/en/security/auth/access-control/index.html#secret-acls) for the specified secret scope. We recommend a designated scope for the sync so it doesn't remove secrets managed elsewhere.
        </Note>

        When you're done, select **Next**.
    </Step>
    <Step title="Configure the sync options" titleSize="h3">
        Configure the **Sync Options** to specify how secrets should be synced.

        ![Configure Options](/images/secret-syncs/databricks/databricks-options.png)

        - **Initial Sync Behavior**: How Infisical resolves the initial sync.
            - **Overwrite Destination Secrets**: Removes any secrets at the destination not present in Infisical.
            <Note>
                The Databricks Secret Sync doesn't support importing secrets.
            </Note>
        - **Key Schema**: Template that transforms secret names when syncing. Use `{{secretKey}}` for the original secret name and `{{environment}}` for the environment.
            <Note>
                Use a **Key Schema** so Infisical only manages the keys that match the schema, leaving other keys untouched.
            </Note>
        - **Auto-Sync Enabled**: When enabled, secrets sync automatically as the source changes. Disable to sync manually only.
        - **Disable Secret Deletion**: When enabled, Infisical doesn't remove secrets from the destination. Enable this if you intend to manage some secrets manually outside of Infisical.

        When you're done, select **Next**.
    </Step>
    <Step title="Configure the details" titleSize="h3">
        Give the sync a **Name** and an optional **Description**. The name must be slug-friendly.

        ![Configure Details](/images/secret-syncs/databricks/databricks-details.png)

        Then select **Next**.
    </Step>
    <Step title="Review and create" titleSize="h3">
        Review your Databricks Sync configuration, then select **Create Sync**.

        ![Confirm Configuration](/images/secret-syncs/databricks/databricks-review.png)

        ![Sync Secrets](/images/secret-syncs/databricks/databricks-created.png)

        <Check>
            The sync is created. If auto-sync is enabled, it begins syncing secrets to the selected Databricks secret scope right away.
        </Check>
    </Step>
</Steps>