Skip to main content

Databricks Connector

Databricks Manage compute, workflow jobs, ML models, SQL queries and more within a Databricks workspace.

Connections

Databricks Personal Access Token

While service principal authentication is the recommended method for authenticating with the Databricks REST API, you can also use personal access tokens (which are tied to specific users). To generate a personal access token:

  1. Open https://accounts.cloud.databricks.com/workspaces and select your workspace. Open the URL for your workspace (e.g., https://dbc-00000000-aaaa.cloud.databricks.com) and log in.
  2. From the top-right click your user icon and select Settings.
  3. Under the User > Developer tab, select Manage under Access tokens.
  4. Click the Generate New Token button. Enter a description for the token and click Generate. Omit Lifetime (days) to create a token that never expires.

Your token will look similar to dap000000000000000000000000000000000. Copy this token and use it as the token input for the Databricks components.

When configuring an instance, enter the personal access token along with your workspace's endpoint (like dbc-REPLACE-ME.cloud.databricks.com).

See https://docs.databricks.com/en/dev-tools/auth/pat.html for more information on personal access token authentication.

InputCommentsDefault
HostThe hostname of your Databricks instance. Include the entire domain name. For example, dbc-1234567890123456.cloud.databricks.com
Personal Access TokenFrom DataBricks, go to User Settings > Developer > Access Tokens > Manage > Generate New Token

Databricks Workspace Service Principal

With service principal authentication, you create a service user within your account, grant the user permissions to a workspace, and then generate a client ID and secret pair for that service user. This component uses that key pair to authenticate with workspaces that the service account has been granted permissions to. This is the best practice for authenticating with the Databricks REST API.

To set up service principal authentication, you need to:

  1. Create the service principal
    1. Open https://accounts.cloud.databricks.com/users. Under the Service principals tab select Add service principal.
    2. Give the service principal any name and click Add.
  2. Grant the service principal permission to your workspace
    1. Navigate to https://accounts.cloud.databricks.com/workspaces and select your workspace
    2. Under the Permissions tab select Add permissions
    3. Search for the service principal you created and grant the permission Admin.
  3. Generate a key pair for the service principal
    1. Navigate to the service principal and open the Principal information tab.
    2. Under OAuth secrets select Generate secret.
    3. Take note of the Secret (i.e. "Client Secret") and Client ID you receive. The client ID should be a UUID like 00000000-0000-0000-0000-000000000000. The client secret will look like dose00000000000000000000000000000000.

When configuring an instance, enter the client ID and client secret along with your workspace's token URL endpoint (like https://dbc-REPLACE-ME.cloud.databricks.com/oidc/v1/token) if you need workspace-level API access.

If you need account-level access to the API (i.e. you need to manage workspaces using this service principal), you will need to grant the service principal administrative access to your account, and your token URL will look like https://accounts.cloud.databricks.com/oidc/accounts/<my-account-id>/v1/token.

See https://docs.databricks.com/en/dev-tools/auth/oauth-m2m.html for more information on service principal OAuth client credential authentication.

This connection uses OAuth 2.0, a common authentication mechanism for integrations. Read about how OAuth 2.0 works here.

InputCommentsDefault
Token URLThe OAuth 2.0 Token URL for your Databricks workspace. Replace REPLACE-ME in https://dbc-REPLACE-ME.cloud.databricks.com/oidc/v1/token to reflect your workspace's URL.https://dbc-REPLACE-ME.cloud.databricks.com/oidc/v1/token
ScopesOAuth scopes to request. Defaults to all-apis.all-apis
Service Principal Client IDClient ID of your Service Principal. Make sure that your service principal has been granted the necessary permissions in your Databricks workspace. https://docs.databricks.com/en/dev-tools/auth/oauth-m2m.html#step-2-assign-workspace-level-permissions-to-the-databricks-service-principal
Service Principal Client SecretClient Secret of your Service Principal.

Actions

Create Execution Context

Create a Databricks execution context

InputCommentsDefault
Connection
Cluster IDThe unique identifier for the cluster
Languagepython
Debug RequestEnabling this flag will log out the current request.false

Get Cluster

Get a Databricks cluster by ID

InputCommentsDefault
Connection
Cluster IDThe unique identifier for the cluster
Debug RequestEnabling this flag will log out the current request.false

Get Command Status

Gets the status of and, if available, the results from a currently executing command.

InputCommentsDefault
Connection
Cluster IDThe unique identifier for the cluster
Execution Context IDThe ID of the execution context, likely created by the Create Execution Context action.
Command IDThe ID of the command to get the status of
Debug RequestEnabling this flag will log out the current request.false

Get Current User

Get the currently authenticated Databricks user or service principal.

InputCommentsDefault
Connection
Debug RequestEnabling this flag will log out the current request.false

Get SQL Warehouse

Get an SQL Warehouse

InputCommentsDefault
Connection
Warehouse IDThe ID of an SQL warehouse
Debug RequestEnabling this flag will log out the current request.false

List Clusters

Return information about all pinned clusters, active clusters, up to 200 of the most recently terminated all-purpose clusters in the past 30 days, and up to 30 of the most recently terminated job clusters in the past 30 days.

InputCommentsDefault
Connection
Debug RequestEnabling this flag will log out the current request.false

List Node Types

Returns a list of supported Spark node types. These node types can be used to launch a cluster.

InputCommentsDefault
Connection
Debug RequestEnabling this flag will log out the current request.false

List SQL Warehouses

List all SQL Warehouses in the Databricks workspace

InputCommentsDefault
Connection
Debug RequestEnabling this flag will log out the current request.false

Raw Request

Send raw HTTP request to the Databricks API.

InputCommentsDefault
Connection
URLThe URL https:///api/ is prepended to the URL you provide here. For example, if you provide "/2.0/clusters/list", the full URL will be "https://${host}/api/2.0/clusters/list". You can also provide a full URL with protocol (i.e. "https://accounts.cloud.databricks.com/api/2.0/accounts/{account_id}/scim/v2/Groups" to override the prepended base URL.
MethodThe HTTP method to use.
DataThe HTTP body payload to send to the URL.
Form DataThe Form Data to be sent as a multipart form upload.
File DataFile Data to be sent as a multipart form upload.
File Data File NamesFile names to apply to the file data inputs. Keys must match the file data keys above.
Query ParameterA list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2.
HeaderA list of headers to send with the request.
Response TypeThe type of data you expect in the response. You can request json, text, or binary data.json
TimeoutThe maximum time that a client will await a response to its request
Debug RequestEnabling this flag will log out the current request.false
Retry Delay (ms)The delay in milliseconds between retries. This is used when 'Use Exponential Backoff' is disabled.0
Retry On All ErrorsIf true, retries on all erroneous responses regardless of type. This is helpful when retrying after HTTP 429 or other 3xx or 4xx errors. Otherwise, only retries on HTTP 5xx and network errors.false
Max Retry CountThe maximum number of retries to attempt. Specify 0 for no retries.0
Use Exponential BackoffSpecifies whether to use a pre-defined exponential backoff strategy for retries. When enabled, 'Retry Delay (ms)' is ignored.false

Restart Cluster

Restart a Databricks cluster by ID

InputCommentsDefault
Connection
Cluster IDThe unique identifier for the cluster
Debug RequestEnabling this flag will log out the current request.false

Run Command

Run a command in a Databricks execution context

InputCommentsDefault
Connection
Cluster IDThe unique identifier for the cluster
Execution Context IDThe ID of the execution context, likely created by the Create Execution Context action.
Languagepython
CommandThe executable code to run in the execution context
Debug RequestEnabling this flag will log out the current request.false

SQL: Execute an SQL Statement

Run a SQL query in the Databricks workspace. You can choose to wait for the result or asynchronously issue the request and return the statement ID.

InputCommentsDefault
Connection
Warehouse IDThe ID of an SQL warehouse
SQL StatementThe SQL statement to run
SQL ParametersThe parameters to use in the SQL statement. This should represent an array of objects, and each object should have a name and value. For example, [{ "name": "my_name", "value": "the name" }
Debug RequestEnabling this flag will log out the current request.false

Start SQL Warehouse

Start an SQL Warehouse

InputCommentsDefault
Connection
Warehouse IDThe ID of an SQL warehouse
Debug RequestEnabling this flag will log out the current request.false

Start Terminated Cluster

Start a terminated Databricks cluster by ID

InputCommentsDefault
Connection
Cluster IDThe unique identifier for the cluster
Debug RequestEnabling this flag will log out the current request.false

Stop SQL Warehouse

Stop an SQL Warehouse

InputCommentsDefault
Connection
Warehouse IDThe ID of an SQL warehouse
Debug RequestEnabling this flag will log out the current request.false

Terminate Cluster

Terminate a Databricks cluster by ID

InputCommentsDefault
Connection
Cluster IDThe unique identifier for the cluster
Debug RequestEnabling this flag will log out the current request.false