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
Valued Contributor II
Valued Contributor II

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
Valued Contributor
Valued Contributor

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
Valued Contributor II
Valued Contributor II

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

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!