Relative Content

Tag Archive for pythonpysparkjdbcdatabricksazure-ad-msal

Token (Access) Errors Connecting to MS SQL Server From DataBricks Python Notebooks Via PySPark JDBC Driver Using an Azure Service Principal and MSAL

How do I resolve token (Active Directory access) errors when connecting to MS SQL Server from DataBricks Python notebooks via PySPark JDBC driver using an Azure/DataBricks Service Principal and MSAL (Microsoft Authentication Library)? I have tried both the PySpark JDBC driver package (current Maven coordinates: com.databricks:databricks-jdbc:2.6.25) and the Microsoft SQL Connector (current Maven coordinates: com.microsoft.azure:spark-mssql-connector_2.12:1.1.0) and MSAL. It works with ADAL but I get token errors with either of these libraries. What is the correct way to make this connection?