Creating a service principal for Databricks

Creating a service principal in Databricks involves setting up programmatic access for tasks like automation, integration, or API-based operations. Service principals provide secure, non-interactive authentication for applications.

1. Log in to Databricks

2. Navigate to Account Console

  • Click on your username in the top-right corner
  • Select Manage Account from the dropdown menu
  • Go to the User management section

3. Create the Service Principal

  1. Click on the Service principals tab
  2. Click Add service principal
  3. Enter a descriptive Application ID (e.g., fabi-integration-sp)
  4. Optionally add a Display name for easier identification
  5. Click Add to create the service principal

4. Generate Personal Access Token

After creating the service principal, generate access credentials:
  1. Navigate to your Databricks workspace (not Account Console)
  2. Click your username → User Settings
  3. Go to the Developer tab
  4. Click Manage next to Access tokens
  5. Click Generate new token
  6. Set Comment as “Fabi.ai Integration”
  7. Set appropriate Lifetime (e.g., 90 days)
  8. Click Generate
  9. Copy and securely store the token - it won’t be shown again

5. Assign Permissions

Grant the service principal necessary permissions:
-- Grant access to specific databases/schemas
GRANT SELECT ON DATABASE your_database TO `service-principal-application-id`;
GRANT SELECT ON SCHEMA your_database.your_schema TO `service-principal-application-id`;

-- Or grant broader access if needed
GRANT SELECT ON CATALOG your_catalog TO `service-principal-application-id`;

6. Configure Workspace Access

  1. In your Databricks workspace, go to Admin Settings
  2. Click Users and groups
  3. Add the service principal to your workspace
  4. Assign appropriate workspace-level permissions

Connecting Databricks to Fabi.ai

Once you’ve generated your service principal credentials, follow the steps in Connecting to Your Data. You’ll need:
  • Server hostname: Your Databricks workspace URL
  • HTTP path: Found in your cluster/SQL warehouse connection details
  • Access token: The personal access token generated above
  • Service principal ID: The application ID of your service principal
For information about our industry-leading security practices, check out our Security hub.