cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.