Account client not able to get workspace client

vaishalisai
New Contributor II

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-

workspaces = account_client.workspaces.list()
workspace_obj=account_client.get_workspace_client(workspaces[0])
 
I got error saying - 

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