Hello,
I am having trouble using Managed Identity Authentication in Unity Catalog using pyodbc in Azure Databricks. The same code works on a "Legacy Shared Compute". The code snippet is below:
 
import pyodbc
 
jdbc_url = (
    "DRIVER={ODBC 17 DRIVER PATH};"
    "SERVER=AzureSQLServer.database.windows.net,1433;"
    "DATABASE=AzureSQLDBName;"
    "Authentication=ActiveDirectoryMsi;"
    "TrustServerCertificate=no;"
    "Encrypt=yes")
 
conn = pyodbc.connect(jdbc_url)
 
If I run this on a "Shared Compute" enabled for Unity Catalog, I get a connection timeout error:
('HYT00', '[HYT00] [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (0) (SQLDriverConnect)')
If I switch to using UID/PWD, then it works on the Unity Catalog as well. So, not sure why Managed Identity would not work on a Unity Catalog enabled cluster but work on the Legacy cluster. 
 
Any thoughts would be appreciated.
 
Thanks,
Rushi