problem switching profile when using databricks cli
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 04:42 AM
Hi
I have installed databricks CLI and have created some different profiles, and havnt had any problems until now. When i try to use a specific profile with my commands using the --profile flag, fx "databricks secrets list-scopes --profile prod" i encounted the following error:
Error: cannot resolve bundle auth configuration: config host mismatch: profile uses host https://adb-1014xxxxxx.xx.azuredatabricks.net, but CLI configured to use adb-1953xxxx.xx.azuredatabricks.net
So it seems my databricks cli continues to be linked to my "test" profile somehow.
I have tried to authenticate to the prod workspace, but still encounter the same issue, for my prod profile with:
databricks auth login --host https://adb-1014xxxxxx.xx.azuredatabricks.net
Im running my databricks cli commands from the ubuntu terminal in wsl2. Anyone have an idea ro resolve this issue?
alternativly how to properly uninstall databricks cli so i can try and set it up again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 05:16 AM
Hello!
It looks like your Databricks CLI is still linked to your “test” profile, causing the host mismatch error. Here are a few steps to resolve this:
Check Configuration: Ensure your .databrickscfg file has the correct host for each profile. You can find this file in your home directory.
Specify Profile: When running commands, explicitly specify the profile using the --profile flag:
databricks secrets list-scopes --profile prod
Re-authenticate: Re-authenticate to the correct workspace:
databricks auth login --host https://adb-1014xxxxxx.xx.azuredatabricks.net --profile prod
Uninstall and Reinstall CLI: If the issue persists, you can uninstall and reinstall the Databricks CLI:
pip uninstall databricks-cli
pip install databricks-cli
These steps should help resolve the host mismatch issue.
Good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 05:28 AM - edited 09-16-2024 05:38 AM
Hi @NielsMH ,
By default, the Databricks CLI looks for the .databrickscfg file in your ~ (your user home) folder on Unix. You can try to delete this file and run configuration process again.
You can also use describe command to check what credentials and the source of those credentials are being used by CLI:
databricks auth describe
But I suspect you may have encountered the case described below, which is CLI is inferring host from the bundle in the same path. To check if that's the case run the command above

