Problem: Databricks Apps timeout when connecting to SQL Warehouses, but same connection works locally. First Databricks App I've attempted to create. Symptoms:
- Local Streamlit app works fine with Databricks SQL connector
- Deployed Databricks App hangs while attempting connection to the data warehouse
- Same server_hostname, http_path
- App runs as service principal, local runs as user account
Technical Details:
- Using databricks-sql-connector Python package
- Unity Catalog (makena_dev.default)
- Pro SQL Warehouse (not Serverless)
- App has "Can Use" warehouse permissions, it also has access to the catalog, schema and specific table
- Connection timeout after 30-90 seconds
One thing I noticed is if I log into the Databricks GUI, it says my catalog is "hive_metastore". I added some diags in the application and it also says "hive_metastore" is catalog when I run locally.
Feel free to ask additional questions!!!