โ04-08-2025 10:29 AM
Any documentation available to connect from the Azure SQL database to Azure Databricks SQL workspace. We created a SQL warehouse personal access token for a user in a different team who can connect from his on-prem SQL DB to Databricks using the connectors. Now the same user needs to connect from Azure SQL database. I can see many docs for connecting to and interacting with the Azure SQL Database from Databricks workspace but not the other way around. ie from Azure SQL DB to Databricks workspace.
โ04-08-2025 11:16 AM
Can I ask what types of operations do you plan on taking against Databricks from withing Azure SQL Database?
โ04-08-2025 10:49 PM
@BigRoux : They query the data from the SQL warehouse in large volumes into the SQL DB. I think they have a webapp connecting to their database.
โ04-09-2025 04:45 AM
To connect an Azure SQL Database to an Azure Databricks workspace for initiating a relationship where the SQL Database interacts with Databricks (rather than the typical reverse flow), no standard methodology is outlined in public Databricks documentation. Most guides focus on data ingestion from Azure SQL Database to Databricks, not the reverse.
However, Lakehouse Federation in Unity Catalog may provide a viable approach for querying external sources like Azure SQL Database without moving data. Here's a concise summary:
1. Lakehouse Federation Overview:
- Unity Catalog enables federated queries on external databases, allowing data to remain in Azure SQL Database while being queried through Databricks.
2. Setup Steps:
- Connection: Establish a connection to Azure SQL Database in Unity Catalog using host details, credentials, and authentication methods (e.g., OAuth or private networking).
- Foreign Catalog: Create a "foreign catalog" object in Unity Catalog to mirror Azure SQL Database for query execution.
3. Access Control:
- Unity Catalog provides fine-grained access control, ensuring secure and authorized querying of external data sources.
4. Networking Requirements:
- Secure network connectivity between Databricks compute resources (e.g., clusters) and Azure SQL Database is essential. Use Private Link, VNet peering, or firewall allowlisting.
5. Limitations:
- Queries via Lakehouse Federation are typically read-only.
- Compatibility and performance may vary based on Databricks Runtime version and configurations.
Directly enabling Azure SQL Database to "push data" or communicate towards Databricks is uncommon. Most workflows involve reading data *into* Databricks for downstream analytics.
For federated querying setups, refer to [Microsoft Databricks documentation](https://learn.microsoft.com/en-us/azure/databricks/query-federation/sql-server) for detailed configurations.
For bidirectional flows or advanced use cases, custom solutions like APIs or triggers in Azure SQL may be required. Let me know if you need further clarification!
Sources
โ06-03-2025 08:14 AM
We provided some workarounds for some teams who manages data in on-prem like configuring "Databricks extension for Visual Studio Code" and so on. But for a team who manages their entire data in Azure SQL, we are still not successful to provide data. Can you please throw some light on the "APIs or triggers in Azure SQL" you have mentioned there?
โ06-04-2025 04:24 AM
SQL Trigger: Define a trigger in Azure SQL that activates on specific DML operations (e.g., INSERT, UPDATE).
External Call: The trigger can log events to an intermediate service (like a control table or Event Grid).
Webhook Execution: Use Azure Functions or Logic Apps to monitor these events and call the Databricks REST API, triggering a job or notebook.
This pattern simulates a โpushโ from Azure SQL into Databricks via serverless compute.
Passionate about hosting events and connecting people? Help us grow a vibrant local communityโsign up today to get started!
Sign Up Now