export DATABRICKS_HOST is not working with Databricks cli

Bhanu Anjaneya Swami Muddhana 21 Reputation points
2023-04-29T02:25:46.58+00:00

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.
2,272 questions
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA 90,351 Reputation points
    2023-05-02T05:37:50.38+00:00

    @Bhanu Anjaneya Swami Muddhana - 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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.