configure command group

Note

This information applies to Databricks CLI versions 0.205 and above, which are in Public Preview. To find your version of the Databricks CLI, run databricks -v.

The configure command group within the Databricks CLI enables you to authenticate the Databricks CLI with Azure Databricks by using Azure Databricks personal access tokens.

Note

As a security best practice, when you authenticate with automated tools, systems, scripts, and apps, Databricks recommends that you use personal access tokens belonging to service principals instead of workspace users. To create tokens for service principals, see Manage tokens for a service principal.

Note that this article covers only Azure Databricks personal access token and Microsoft Entra ID token authentication for enabling the calling of workspace-level commands. For additional authentication configuration options, see Authentication for the Databricks CLI.

Important

Before you run this command, be sure to set up the Databricks CLI.

You run configure commands by appending them to databricks configure. To display help for the configure command, run databricks configure -h.

Create a configuration profile

A configuration profile is a collection of settings that contains authentication information such as an Azure Databricks workspace URL and an access token value. A configuration profile has a programmatic name, such as DEFAULT, DEV, or PROD.

To create a configuration profile, run the configure command as follows:

databricks configure --host <workspace-url>

For <workspace-url>, enter your per-workspace URL, with the format https://adb-<workspace-id>.<random-number>.databricks.azure.cn. To get the per-workspace URL, see Per-workspace URL.

The command prompts you to enter your Azure Databricks personal access token that maps to the specified <workspace-url>:

✔ Databricks Token:

After you enter your access token, your access token is stored in the file ~/.databrickscfg on Linux or macOS, or %USERPROFILE%\.databrickscfg on Windows by default. The file contains a default connection profile entry named DEFAULT:

[DEFAULT]
host  = <workspace-url>
token = <access-token>

To use a different name for your connection profile instead of DEFAULT, add the --profile option to the configure command, for example:

databricks configure --host <workspace-url> --profile <profile-name>

Tip

You can press Tab after --profile or -p to display a list of existing available configuration profiles to choose from, instead of entering the configuration profile name manually.

Any existing host and token information within the specified connection profile is overwritten with the new host and token information.

Adding multiple connection profiles to the .databrickscfg file enables you to quickly run commands across various workspaces by specifying the target connection profile's name in the command's --profile option. If you do not specify the --profile option in a command that supports this option, the command will use the DEFAULT connection profile by default.

For example, you could have a connection profile named DEV that references an Azure Databricks workspace that you use for development workloads and a separate connection profile named PROD connection profile that references a different Azure Databricks workspace that you use for production workloads.

You can change the default path of this .databrickscfg file by setting the environment variable DATABRICKS_CONFIG_FILE. To learn how to set environment variables, see your operating system's documentation.

To get information about existing configuration profiles, use the auth command group.