---
title: Configuration profiles for the Databricks CLI
description: Learn about configuration profiles for the Databricks CLI. Configuration profiles enable you to switch quickly between Databricks environments as you run CLI commands.
canonical_url: https://docs.databricks.com/aws/en/dev-tools/cli/profiles
---

# Configuration profiles for the Databricks CLI

> [!NOTE]
>
> Databricks CLI use is subject to the [Databricks License](https://github.com/databricks/cli?tab=License-1-ov-file#readme) and [Databricks Privacy Notice](https://www.databricks.com/legal/privacynotice), including any Usage Data provisions.

This article describes how to use the Databricks CLI with configuration profiles. It assumes that you have already installed the Databricks CLI and created a Databricks configuration profiles file. See [Install or update the Databricks CLI](https://docs.databricks.com/aws/en/dev-tools/cli/install.md) and [Databricks configuration profiles](https://docs.databricks.com/aws/en/dev-tools/auth/config-profiles.md).

## <a id="using-profiles" />Get information about configuration profiles

Adding multiple configuration profiles to the `.databrickscfg` file enables you to quickly run commands across various workspaces by specifying the target configuration profile's name in the command's `--profile` or `-p` flag. If you do not specify a profile, the CLI selects one in the following order:

1. The `DATABRICKS_CONFIG_PROFILE` environment variable, if set.
2. The `default_profile` setting in the `[__settings__]` section of `.databrickscfg`, if present. You can set this with `databricks auth switch`. See [databricks auth switch](https://docs.databricks.com/aws/en/dev-tools/cli/reference/auth-commands.md#switch).
3. The `DEFAULT` profile.

> [!TIP]
>
> You can press `Tab` after `--profile` or `-p` to display a list of existing available configuration profiles from which to choose.

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

By default, the Databricks CLI looks for the `.databrickscfg` file in your `~` (your user home) folder on Unix, Linux, or macOS, or your `%USERPROFILE%` (your user home) folder on Windows. To change the default path of the `.databrickscfg` file, set the environment variable `DATABRICKS_CONFIG_FILE` to a different path. See [.databrickscfg-specific fields](https://docs.databricks.com/aws/en/dev-tools/auth/env-vars.md#config-profiles).

To get information about an existing configuration profile, run the `auth describe` command:

```bash
databricks auth describe --profile <configuration-profile-name>
```

For example, here is the output for a profile that is configured with Databricks personal access token authentication:

```output
Host: https://dbc-a1b2345c-d6e7.cloud.databricks.com
User: user@example.com
Authenticated with: pat
-----
Current configuration:
  ✓ host: https://dbc-a1b2345c-d6e7.cloud.databricks.com (from ~/.databrickscfg config file)
  ✓ token: ******** (from ~/.databrickscfg config file)
  ✓ profile: <configuration-profile-name> (from --profile flag)
  ✓ auth_type: pat
```

> [!NOTE]
>
> The `auth env` command is deprecated. Use `databricks auth describe` to inspect a profile's configuration, or `databricks auth token` to retrieve a cached OAuth access token.

To get information about all available profiles, run the `auth profiles` command:

```bash
databricks auth profiles
```

```output
Name                     Host                                            Valid
DEFAULT                  https://dbc-a1b2345c-d6e7.cloud.databricks.com  YES
Development              https://dbc-a1b2345c-d6e7.cloud.databricks.com  YES
Staging                  https://dbc-a1b2345c-d6e7.cloud.databricks.com  YES
Production               https://dbc-a1b2345c-d6e7.cloud.databricks.com  YES
```

The output of the `auth profiles` command does not display any access tokens. To display token details for a specific profile, run `databricks auth describe --profile <profile-name>` or `databricks auth token --profile <profile-name>`.

> [!IMPORTANT]
>
> The Databricks CLI does not work with a [.netrc file](https://everything.curl.dev/usingcurl/netrc.html). You can have a `.netrc` file in your environment for other purposes, but the Databricks CLI will not use that `.netrc` file.

## <a id="test" />Test your configuration profiles

To test your configuration profiles and verify that you have set up authentication correctly, run a command that connects to a workspace.

If you don't specify a profile, the default profile is used. For example, the following command lists the available Databricks Runtime versions for the Databricks workspace that is associated with your `DEFAULT` profile.

> [!NOTE]
>
> This command assumes that you do not have any environment variables set that take precedence over the settings in your `DEFAULT` profile. For more information, see [Authentication order of evaluation](https://docs.databricks.com/aws/en/dev-tools/cli/authentication.md#auth-eval).

```bash
databricks clusters spark-versions
```

To verify a specific configuration profile, provide the profile name using the `-p` flag.

```bash
databricks clusters spark-versions -p PROD
```
