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: "Databricks service principal secret rotation"
sidebarTitle: "Databricks service principal secret"
description: "Learn how to automatically rotate Databricks Service Principal OAuth Secrets."
---
import ConfigureServicePrincipal from "/snippets/app-connections/databricks/configure-service-principal-for-rotation.mdx";
import ConnectionFormFields from "/snippets/app-connections/databricks/form-fields.mdx";
Rotate the OAuth client secret of a Databricks service principal on a schedule.
<Info>
**Rotation Type: Dual-Phase**
This rotation maintains two active credential sets with overlapping validity, ensuring zero-downtime during rotation cycles.
</Info>
<Note>
This rotation needs 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)
- Network access from Infisical to your Databricks workspace, if network restrictions apply
## Step 1: Set up in Databricks
Create a service principal Infisical can use to reach the workspace and grant it permission to reset the secrets of every service principal you want to rotate.
<ConfigureServicePrincipal />
## Step 2: Set up the rotation in Infisical
<Tip>
To create the rotation using the API, use the [Create Databricks Service Principal Secret Rotation](/api-reference/endpoints/secret-rotations/databricks-service-principal-secret/create) endpoint.
</Tip>
<Steps>
<Step title="Add the rotation" titleSize="h3">
In your Secrets Management project, open the dashboard and select **Add Secret Rotation** from the actions dropdown.

Then, select the **Databricks Service Principal** rotation:

</Step>
<Step title="Configure the app connection" titleSize="h3">
Create or select the Databricks app connection the rotation will use.
<Tabs>
<Tab title="Create a new app connection">
Under **Databricks Connection**, select **Create Connection**, then choose **Databricks Connection**. Select the **Service Principal** method and complete the form:
<ConnectionFormFields />

Then, select **Connect to Databricks**.
<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 rotation" titleSize="h3">
Set the rotation behavior.

- **Rotation Interval**: The interval, in days, that once elapsed triggers a rotation.
- **Rotate At**: The local time of day when rotation should occur once the interval has elapsed.
- **Auto-Rotation Enabled**: When enabled, secrets rotate automatically once the interval elapses. Disable to rotate manually or pause rotation.
When you're done, select **Next**.
</Step>
<Step title="Pick the target service principal" titleSize="h3">
Select the Databricks service principal whose OAuth secret you want to rotate, then select **Next**.

</Step>
<Step title="Map the rotated values to secret names" titleSize="h3">
Specify the secret names that the client credentials should be mapped to, then select **Next**.

- **Client ID**: The name of the secret the service principal Client ID is written to.
- **Client Secret**: The name of the secret the rotated OAuth Client Secret is written to.
</Step>
<Step title="Configure the details" titleSize="h3">
Give the rotation a **Name** and an optional **Description**, then select **Next**. The name must be slug-friendly.

</Step>
<Step title="Review and create" titleSize="h3">
Review your configuration, then select **Create Secret Rotation**.


<Check>
Your Databricks service principal credentials are now available through the mapped secrets. If auto-rotation is enabled, they rotate on your configured schedule.
</Check>
</Step>
</Steps>