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.
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:
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.