Files
kms/docs/documentation/platform/secret-rotation/databricks-service-principal-secret.mdx
zeekay 0ebffbd529 fix: white-label KMS branding and fix broken identifiers
- Fix 381 files where branding script corrupted variable names
  (e.g. isHanzo KMSTemplate -> isKmsTemplate)
- Rebrand from "Hanzo KMS" to just "KMS" for white-label support
  (allows Lux KMS, Hanzo KMS, etc. via configuration)
- 856 files, purely string replacements, no logic changes
2026-02-13 10:25:11 -08:00

145 lines
7.1 KiB
Plaintext

---
title: "Databricks Service Principal Secret"
description: "Learn how to automatically rotate Databricks Service Principal OAuth Secrets."
---
<Note>
**Rotation Type: Dual-Phase**
This rotation maintains two active credential sets with overlapping validity, ensuring zero-downtime during rotation cycles.
</Note>
## Prerequisites
- Ensure you've configured the service principal for rotation. See [Configure Permissions for Secret Rotation](/integrations/app-connections/databricks#configure-permissions-for-secret-rotation).
- Ensure your network security policies allow incoming requests from KMS to this rotation provider, if network restrictions apply.
## Create a Databricks Service Principal Secret Rotation in KMS
<Tabs>
<Tab title="KMS UI">
1. Navigate to your Secret Manager Project's Dashboard and select **Add Secret Rotation** from the actions dropdown.
![Secret Manager Dashboard](/images/secret-rotations-v2/generic/add-secret-rotation.png)
2. Select the **Databricks Service Principal Secret** option.
![Select Databricks Service Principal Secret](/images/secret-rotations-v2/databricks-service-principal-secret/databricks-service-principal-secret-option.png)
3. Select the **Databricks Connection** to use and configure the rotation behavior. Then click **Next**.
![Rotation Configuration](/images/secret-rotations-v2/databricks-service-principal-secret/databricks-service-principal-secret-configuration.png)
- **Databricks Connection** - the connection that will perform the rotation of the specified service principal's OAuth secret.
- **Rotation Interval** - the interval, in days, that once elapsed will trigger a rotation.
- **Rotate At** - the local time of day when rotation should occur once the interval has elapsed.
- **Auto-Rotation Enabled** - whether secrets should automatically be rotated once the rotation interval has elapsed. Disable this option to manually rotate secrets or pause secret rotation.
4. Select the Databricks service principal whose OAuth secret you want to rotate. Then click **Next**.
![Rotation Parameters](/images/secret-rotations-v2/databricks-service-principal-secret/databricks-service-principal-secret-parameters.png)
5. Specify the secret names that the client credentials should be mapped to. Then click **Next**.
![Rotation Secrets Mapping](/images/secret-rotations-v2/databricks-service-principal-secret/databricks-service-principal-secret-mapping.png)
- **Client ID** - the name of the secret that the service principal Client ID will be mapped to.
- **Client Secret** - the name of the secret that the rotated OAuth Client Secret will be mapped to.
6. Give your rotation a name and description (optional). Then click **Next**.
![Rotation Details](/images/secret-rotations-v2/databricks-service-principal-secret/databricks-service-principal-secret-details.png)
- **Name** - the name of the secret rotation configuration. Must be slug-friendly.
- **Description** (optional) - a description of this rotation configuration.
7. Review your configuration, then click **Create Secret Rotation**.
![Rotation Review](/images/secret-rotations-v2/databricks-service-principal-secret/databricks-service-principal-secret-review.png)
8. Your **Databricks Service Principal Secret** credentials are now available for use via the mapped secrets.
![Rotation Created](/images/secret-rotations-v2/databricks-service-principal-secret/databricks-service-principal-secret-created.png)
</Tab>
<Tab title="API">
To create a Databricks Service Principal Secret Rotation, make an API request to the [Create Databricks Service Principal Secret Rotation](/api-reference/endpoints/secret-rotations/databricks-service-principal-secret/create) API endpoint.
### Sample request
```bash Request
curl --request POST \
--url https://us.kms.hanzo.ai/api/v2/secret-rotations/databricks-service-principal-secret \
--header 'Content-Type: application/json' \
--data '{
"name": "my-databricks-rotation",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "my service principal secret rotation",
"connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment": "dev",
"secretPath": "/",
"isAutoRotationEnabled": true,
"rotationInterval": 30,
"rotateAtUtc": {
"hours": 0,
"minutes": 0
},
"parameters": {
"servicePrincipalId": "76997828332531",
"servicePrincipalName": "my-service-principal",
"clientId": "..."
},
"secretsMapping": {
"clientId": "DATABRICKS_CLIENT_ID",
"clientSecret": "DATABRICKS_CLIENT_SECRET"
}
}'
```
### Sample response
```bash Response
{
"secretRotation": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "my-databricks-rotation",
"description": "my service principal secret rotation",
"secretsMapping": {
"clientId": "DATABRICKS_CLIENT_ID",
"clientSecret": "DATABRICKS_CLIENT_SECRET"
},
"isAutoRotationEnabled": true,
"activeIndex": 0,
"folderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"rotationInterval": 30,
"rotationStatus": "success",
"lastRotationAttemptedAt": "2023-11-07T05:31:56Z",
"lastRotatedAt": "2023-11-07T05:31:56Z",
"lastRotationJobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextRotationAt": "2023-11-07T05:31:56Z",
"connection": {
"app": "databricks",
"name": "my-databricks-connection",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"environment": {
"slug": "dev",
"name": "Development",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"folder": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"path": "/"
},
"rotateAtUtc": {
"hours": 0,
"minutes": 0
},
"lastRotationMessage": null,
"type": "databricks-service-principal-secret",
"parameters": {
"servicePrincipalId": "76997828332531",
"servicePrincipalName": "my-service-principal",
"clientId": "..."
}
}
}
```
</Tab>
</Tabs>