Trinomial
New Contributor III

Hi @Juned Mala​,

I was having exactly the same problem using Azure Databricks. I agree the documentation on setting up Databricks CLI is so inadequate, and others agree.

I'm using Azure Databricks on a Windows machine, with the Anaconda build for Python (authenticating using Anaconda PowerShell Prompt).

I think the problem for me first arose when running

databricks configure --aad-token

before I had set the Environment variable.

We need to make sure the Environment Variable is set before running the above command. I think you have done this part, but for the benefit of other readers I'll post it here. To set the Environment Variable, go to Control Panel, search for Environment Variables and click 'New' to enter a new (User) environment variable:

Variable name = DATABRICKS_AAD_TOKEN

Variable value= <your AD token>

Close down PowerShell and open it again. Run the command

databricks configure --aad-token

again. Enter your Databricks host URL when prompted, e.g.

https://adb-<workspace-id>.<random-number>.azuredatabricks.net

This should update the .databrickscfg file under your User directory (C:\Users\<user.id>) to include the Host and the AAD Token that you entered as the new Environment Variable.

Then try running

databricks workspace list /Users

and hopefully the Users in your Workspace Path will be listed, if authentication has succeeded.

View solution in original post