databricks-sql-python icon indicating copy to clipboard operation
databricks-sql-python copied to clipboard

SQLAlchemy engine from workspace level service principle?

Open timharsch opened this issue 1 year ago • 0 comments

From a remote client, I need to write a script that connects to my SQL Warehouse using a workspace level service principal and creates an SQLAlchemy engine.. which I can then pass to a library that expects the engine.

I did write example scripts that:

  • connect using the Service Principal via python dbapi, thanks to the example provided.
  • creates a SQLALchemy engine using a PAT

I tried quite a few things including using pyodbc, only to discover that it fails as databricks_dbapi/odbc.py only supports username/password or PAT

Is there a way to create a SQLAlchemy engine connected to a SQL Warehouse using a service principle?

timharsch avatar Mar 20 '24 21:03 timharsch