cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How do I use databricks-cli without manual configuration

User16790091296
Contributor II

I want to use databricks cli:

databricks clusters list

but this requires a manual step that requires interactive work with the user:

databricks configure --token

Is there a way to use databricks cli without manual intervention so that you can run it as part of a ci/cd pipeline?

1 ACCEPTED SOLUTION

Accepted Solutions

alexott
Databricks Employee
Databricks Employee

You can set two environment variables: DATABRICKS_HOST and DATABRICKS_TOKEN, and databricks-cli will use them. See the example of that in the DevOps pipeline

see the full list of environment variables at the end of the Authentication section of documentation

View solution in original post

2 REPLIES 2

User16752239289
Databricks Employee
Databricks Employee

You can try configure the credential by editing file ~/.databrickscfg .

The file content will be like below:

[DEFAULT]
host = [workspace url]
username = [email id]
password = [password]
 
[profile 1]
host = [workspace url]
token = {personal access token}

Once you have the file in place, you do not need to run `databricks configure --token ` . The databricks cli will automatically pick up the credentials from the file.

alexott
Databricks Employee
Databricks Employee

You can set two environment variables: DATABRICKS_HOST and DATABRICKS_TOKEN, and databricks-cli will use them. See the example of that in the DevOps pipeline

see the full list of environment variables at the end of the Authentication section of documentation

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group