Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE] WorkspaceClient authentication #780

Open
jd02904 opened this issue Oct 4, 2024 · 0 comments
Open

[ISSUE] WorkspaceClient authentication #780

jd02904 opened this issue Oct 4, 2024 · 0 comments

Comments

@jd02904
Copy link

jd02904 commented Oct 4, 2024

Description
Currently the WorkspaceClient looks up all possible environment variables that can be used for authentication (e.g. Databricks token or Azure credentials) and throws an error if more than one authentication method is used:

raise ValueError(f'validate: more than one authorization method configured: {names}')
.

This means I need to use the following hack to ge try code running which is inconvenient:

del os.environ["ARM_SUBSCRIPTION_ID"]
del os.environ["ARM_TENANT_ID"]
del os.environ["ARM_CLIENT_ID"]
del os.environ["ARM_CLIENT_SECRET"]

Reproduction
ARM_SUBSCRIPTION_ID, ARM_TENANT_ID, ARM_CLIENT_ID, ARM_CLIENT_SECRET, DATABRICKS_HOST and DATABRICKS_TOKEN environment variables must be set to reproduce the example.

import os

from databricks.sdk import WorkspaceClient

w = WorkspaceClient(host=os.environ["DATABRICKS_HOST"], token=os.environ["DATABRICKS_TOKEN"])

Expected behavior
I would expect to be able to authenticate with more than one authentication method as I need both Azure and Databricks credentials in my environment.

Is it a regression?
I don't know. This for version 0.32.3.

Debug Logs
The SDK logs helpful debugging information when debug logging is enabled. Set the log level to debug by adding logging.basicConfig(level=logging.DEBUG) to your program, and include the logs here.

Other Information

  • OS: Ubuntu

Additional context
N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant