Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'databricks configure --token' hangs for input

I run following task in Azure DevOps, it always hangs for input? Why wasn't my bash automatic supply working?

databricksUrl=https://...
databricksToken=*****

databricks configure --token << EOF
$(databricksUrl)
$(databricksToken)
EOF
like image 662
user3023949 Avatar asked Jul 15 '26 01:07

user3023949


2 Answers

There are two solutions for Databricks CLI > 0.11.0:

  • Generate ~/.databricks.cfg directly in form:
echo "[DEFAULT]                                                               
host = $url
token = $token" > ~/.databricks.cfg
  • Use new options --host & --token-file to specify host & token:
echo $token > token-file
databricks configure --host $url --token-file token-file
rm -f token-file
like image 189
Alex Ott Avatar answered Jul 19 '26 19:07

Alex Ott


You try the below Inline bash script to authenticate with Azure Databricks without variables.

databricks configure --token <<EOF
https://centralus.azuredatabricks.net
dapXXXXXXXXXXXXXXXXXXXXXX467
EOF

enter image description here

You try the below Inline bash script to authenticate with Azure Databricks with variables.

adburl="https://centralus.azuredatabricks.net"
token=dapXXXXXXXXXXXXXXXXXXXXXXXXX467
databricks configure --token <<EOF
$adburl
$token
EOF

enter image description here

Successfully authenticated with Azure Databricks:

enter image description here

OR

You can use DevOps for Azure Databricks extension.

This extension brings a set of tasks for you to operationalize build, test and deployment of Databricks Jobs and Notebooks.

Once DevOps for Azure Databricks extension installed, you can directly use Configure Databricks CLI by clicking on the Add tasks.

enter image description here

like image 36
CHEEKATLAPRADEEP-MSFT Avatar answered Jul 19 '26 19:07

CHEEKATLAPRADEEP-MSFT