User/interactive Azure AD authentication
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- authentication, database
Research direction
The issue names dbx_sql.connect, databricks-sdk WorkspaceClient, DefaultAzureCredential, and the existing Entra ID M2M method, but no repository files or tests. Start by locating the connection authentication entry point and its M2M implementation, then compare it with the az login and DefaultAzureCredential flow shown. Done means a supported U2M workflow can authenticate and run the example SQL query.
Written by the indexing model from the issue text.
Description
#621 by @jprakash-db added a great feature that we will be testing ASAP. Since Entra ID authentication seems to be getting upgraded, I wanted to ask about interactive login.
Using databricks-sdk I can perform this user authentication by doing (from the terminal)
az login --use-device-code
...
User is logged in
then in python
from databricks.sdk import WorkspaceClient
w = WorkspaceClient(host="https://adb-XXXXXX.azuredatabricks.net/")
Would the newly-added Entra ID M2M method be extendable for U2M workflows?
Otherwise, is there an alternative implementation I could use?
This is what I'm currently doing to manually mint a token in the user interactive workflow currently:
from azure.identity import DefaultAzureCredential
from databricks import sql as dbx_sql
_DATABRICKS_SCOPE = "2ff814a6-3304-4ab8-85cb-cd0e6f879c1d/.default"
DATABRICKS_CLUSTER_HOST = "adb-XXX.azuredatabricks.net"
DATABRICKS_CLUSTER_HTTP_PATH = "/sql/1.0/warehouses/XXX"
cred = DefaultAzureCredential()
token = cred.get_token(_DATABRICKS_SCOPE)
with dbx_sql.connect(
server_hostname=DATABRICKS_CLUSTER_HOST,
http_path=DATABRICKS_CLUSTER_HTTP_PATH,
access_token=token.token,
) as conn, conn.cursor() as c:
c.execute("SELECT current_user(), current_catalog(), current_schema();")
print(c.fetchall())
Thanks!
- Dominant language
- Python
- Stars
- 236
- Forks
- 162
- Avg merge
- 13h 13m
- Merged PRs (30d)
- 23
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from databricks/databricks-sql-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
databricks/databricks-sql-python#1034 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
databricks/databricks-sql-python#1012 ·
Maintainers usually reply within 1 day
-
Token federation: `_exchange_token` raises KeyError('access_token') on error responses, discarding the real failure reasonPossibly taken @TangoEnSkai claimed this 81 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
databricks/databricks-sql-python#904 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
databricks/databricks-sql-python#865 ·
Maintainers usually reply within 1 day
-
engineer-bot
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
databricks/databricks-sql-python#860 · 3 comments ·
Maintainers usually reply within 1 day
All issues in databricks/databricks-sql-python
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
aws-samples/sample-per-model-bedrock#857 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
521xueweihan/HelloGitHub#4328 ·
-
documentation maintainer-managed
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
awslabs/visual-asset-management-system#1418 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day