export DATABRICKS_HOST is not working with Databricks cli

bhanu m 21 Reputation points

Hello Team, I am trying to automate to manage Azure Databricks work spaces like add and remove users ( Need to manage several workspace).

I have setup environment variables like below

token_response=$(az account get-access-token --resource 2ff814a6-3304-4ab8-85cb-cd0e6f879c1d)
export DATABRICKS_AAD_TOKEN=$(jq .accessToken -r <<< "$token_response")
export DATABRICKS_HOST='my workspace url'

When I am trying to run databricks configure --aad-token

asking working workspace url

Databricks Host (should begin with https://):

Not taking from Environment variables.

I am using latest version of databricks cli. I even tried with pervious versions.

Any suggestions.

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
1,703 questions
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA-MSFT 70,016 Reputation points Microsoft Employee

    @bhanu m - Thanks for the question and using MS Q&A platform.

    Did you creates a file named .databrickscfg in your ~ (your user home) folder on Unix, Linux, or macOS, or your %USERPROFILE% (your user home) folder on Windows, if this file does not already exist.

    User's image

    Note: For first time, you need to pass the values manually or create this file named .databrickscfg in your ~ (your user home) to set as environment variables.
    User's image

    This article Databricks CLI provides an easy-to-use interface to automate the Azure Databricks platform from your terminal, command prompt, or automation scripts.

    Hope this helps. Do let us know if you any further queries.

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.