Skip to main content

Can I access Databricks compute from other environments?

Summary

  • Yes. Databricks compute is reachable from laptops, IDEs, notebook servers, custom applications and CI/CD systems, and the right path depends on what you send it.
  • Databricks Connect lets any IDE, notebook server or application run Spark DataFrame code on Databricks clusters or serverless compute while the rest of the program runs locally.
  • SQL clients reach SQL warehouses through the Databricks JDBC and ODBC drivers, the SQL connector for Python, drivers for Go and Node.js, or the SQL Statement Execution API.
  • The SSH tunnel (Beta) attaches a local IDE or terminal directly to serverless compute, AI Runtime or a dedicated cluster, but it must start from your local machine, not another remote environment or a Docker container.
  • The Databricks CLI, SDKs and REST API submit and manage work from scripts and pipelines, using the same authentication profiles.

Can I access Databricks compute from other environments?

Yes. Databricks compute isn't tied to the workspace UI. A laptop IDE, a notebook server, an application server or a CI runner can all send work to Databricks clusters, serverless compute and SQL warehouses. The question to answer first is what you're sending: Spark DataFrame code, SQL, a whole interactive session, or a job to run later. Each has its own documented path, and Databricks Connect and the CLI both read Databricks configuration profiles.

Which path fits your environment?

Your environment What you want to do Path
IDE, notebook server or Python app Run Spark DataFrame code on Databricks Databricks Connect
BI tool, SQL client or application Run SQL on a SQL warehouse JDBC, ODBC and SQL connectors
Service with no driver installed Run SQL over HTTP SQL Statement Execution API
Local IDE or terminal Work interactively on remote compute SSH tunnel (Beta)
CI/CD runner or script Deploy and trigger jobs and pipelines Databricks CLI, Declarative Automation Bundles, SDKs
Agent or app running untrusted code Execute code in isolation Databricks Sandbox (Beta)

What to check before you connect

  • Authentication. Databricks Connect and the CLI use Databricks configuration profiles. databricks auth login starts OAuth in your browser and offers to save a profile.
  • Network path. The SSH tunnel doesn't use port 22. It carries traffic over HTTPS to your workspace domain and needs WebSocket support, and it respects HTTPS_PROXY and NO_PROXY like other CLI commands.
  • Compute type. Databricks Connect works with clusters and serverless compute. SSH to classic compute needs a dedicated, single-user cluster on Databricks Runtime 17.0 or above with Unity Catalog. Shared clusters aren't supported.
  • Workspace settings. SSH to serverless uses port forwarding to serverless compute, which is on by default except in workspaces with the compliance security profile. Databricks Connect and the Databricks CLI don't use port forwarding.
  • Version compatibility. For serverless, the Databricks Connect version and your Python or Scala version must be compatible.

How Databricks approaches remote access to compute

Databricks Connect for code. Databricks Connect is a client library that lets you connect "IDEs such as Visual Studio Code, PyCharm, and IntelliJ IDEA, notebooks and any custom application" to Databricks compute. It's built on open-source Spark Connect, so DataFrame operations travel as Spark plans over gRPC and results come back to your client. General Python or Scala code still runs locally, and UDFs are serialized and run on Databricks. Configuration can live outside the code, which suits CI and application servers. For serverless, set DATABRICKS_SERVERLESS_COMPUTE_ID to auto, or call the builder directly:

from databricks.connect import DatabricksSession

spark = DatabricksSession.builder.serverless().getOrCreate()

For a cluster, set DATABRICKS_CLUSTER_ID or add cluster_id to the profile.
SQL drivers for queries. The Databricks ODBC and JDBC drivers connect tools and clients to Databricks. The SQL Statement Execution API runs statements "using a REST API without installing drivers or managing connections."
The SSH tunnel for whole sessions. When you want your environment on Databricks rather than calls to it, databricks ssh connect opens a session on serverless compute, and --cluster <cluster-id> targets a dedicated cluster. The tunnel has a hard rule: start it from your local machine. The docs say it "cannot be launched from another remote environment or a Docker container." The IDE comparison puts the tunnel and Databricks Connect side by side.
CLI, SDKs and REST for automation. The Databricks CLI wraps the REST API, so anything the CLI does, a script or pipeline can do. SDKs for Python, JavaScript, Java, Go and R cover application code, and bundles deploy jobs and pipelines from a CI system.
Identity comes with you. Databricks Connect extends Spark Connect with additions for Databricks compute modes and Unity Catalog, and the SSH tunnel is automatically authenticated as the user who starts the session.

FAQs

Can a custom application use Databricks compute?

Yes. The Databricks Connect docs say the library "can be embedded in any application to interact with Databricks," much like a JDBC driver, and SQL applications can use the JDBC, ODBC or language drivers.

Can I start the SSH tunnel from a remote dev container or another VM?

No. The SSH tunnel must start on your local machine. The docs say it can't be launched from another remote environment or a Docker container.

Does turning off serverless port forwarding block Databricks Connect?

No. The port forwarding docs list notebooks, SQL, jobs, Databricks Connect and the Databricks CLI as continuing to work, because they don't use port forwarding.

Which languages can reach Databricks compute?

Databricks Connect ships for Python, R and Scala. SQL drivers cover Java (JDBC), ODBC clients, Python, Go and Node.js, and SDKs exist for Python, JavaScript, Java, Go and R.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.