Account client not able to get workspace client
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2024 03:31 AM
So I did U2M authentication for account-level operations -
databricks auth login --host <account-login-url> --account-id <account-id>
then I tried to run code-
workspace_obj=account_client.get_workspace_client(workspaces[0])
ValueError: databricks-cli auth: cannot configure default credentials, please check https://docs.databricks.com/en/dev-tools/auth.html#databricks-client-unified-authentication to configure credentials for your preferred authentication method.
I am not sure what's going wrong here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2024 06:06 AM
Hi @vaishalisai,
Could you please run below validations?
Run this command to validate: databricks auth describe
Check the Databricks Configuration File: Ensure that your .databrickscfg file is correctly configured. This file should be located in your home directory and should contain the necessary credentials. The file should look something like this: [DEFAULT] host = https://<your-databricks-instance> token = <your-personal-access-token>
Verify Environment Variables: Make sure that the environment variables DATABRICKS_HOST and DATABRICKS_TOKEN are set correctly. These variables should point to your Databricks instance and contain your access token, respectively.
Unified Authentication: According to the documentation, you should ensure that you have configured the unified authentication method correctly. You can refer to the detailed steps in the Databricks documentation here: Databricks Client Unified Authentication.
OAuth for Users (U2M): Since you mentioned using U2M (User-to-Machine) authentication, ensure that you have followed the steps to generate an OAuth code verifier and challenge pair if required. This is necessary for the OAuth authentication process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2024 10:42 PM
I am doing using a service principal so my .databrickscfg has -
client_id = -----
client_secret = ----
host = https://accounts.cloud.databricks.com/
account_id = ----

