Support for Azure AD Service Principal with SQLAlchemy
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- azure, python, sqlalchemy
- Domain
- authentication, databases
Research direction
The issue identifies the SQLAlchemy create_engine URL and connect_args as entry points; begin by tracing how those arguments reach connection creation and pooling. Verify the token lifecycle, with done meaning client_id, client_secret, and scopes are accepted and pooled connections cannot outlive token expiration.
Written by the indexing model from the issue text.
Description
Problem Summary:
When using Azure AD Service Principal, a client-id and client-secret are used to obtain a short-lived token. The token may be used in the connection string:
uri = f"databricks://token:{DATABRICKS_TOKEN}@{DATABRICKS_HOST}:443?http_path={DATABRICKS_HTTP_PATH}"
engine = create_engine(uri)
However, there is no mechanism to ensure that connections do not stay in the connection pool past the token expiration.
Proposed Solution:
Allow client_id and client_secret as connection arguments, and ensure connections do not stay open past token expiration.
url = f"databricks://{DATABRICKS_HOST}:443?http_path={DATABRICKS_HTTP_PATH}"
engine = create_engine(url, connect_args = {client_id: CLIENT_ID, client_secret: CLIENT_SECRET, scopes: SCOPES } )
- Dominant language
- Python
- Stars
- 233
- Forks
- 152
- Avg merge
- 21h 5m
- Merged PRs (30d)
- 10
Contributor 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 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
All issues in databricks/databricks-sql-python
Similar issues
-
essnmx good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
[Feature] 奇物选择添加优先级 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Giskard-AI/giskard-oss#2840 · 1 comment ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Openarea: repo bug perceived difficulty: 2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yeti-platform/yeti#1380 ·