- Notifications
You must be signed in to change notification settings - Fork126
Open
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.
Usingdatabricks-sdk I can perform this user authentication by doing (from the terminal)
az login --use-device-code...User is loggedinthen in python
fromdatabricks.sdkimportWorkspaceClientw=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:
fromazure.identityimportDefaultAzureCredentialfromdatabricksimportsqlasdbx_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)withdbx_sql.connect(server_hostname=DATABRICKS_CLUSTER_HOST,http_path=DATABRICKS_CLUSTER_HTTP_PATH,access_token=token.token,)asconn,conn.cursor()asc:c.execute("SELECT current_user(), current_catalog(), current_schema();")print(c.fetchall())
Thanks!
Metadata
Metadata
Assignees
Labels
No labels