Reputation: 11
Is it possible that a flask web app uploaded to the web app service can connect to databricks? The app should have some dropdown menus and send a command to databricks. Databricks should search the data from the data lake?.
Upvotes: 0
Views: 4119
Reputation: 24128
As I known, there are two ways to connect Azure Databricks in Python.
Refer to the offical document Connect to Azure Databricks from Excel, Python, or R
, you can download and install Simba Spark ODBC Driver
and pyodbc
to follow the section Connect from Python
to retrieve the data from Azure Databricks. However, I don't think you can follow the Simba offical document About the Simba Spark ODBC Driver for Windows
to install and configure the driver on Azure WebApp for Windows, but you can try to follow the document About the Simba Spark ODBC Driver for Unix/Linux
to do on Azure WebApp for Linux.
Alternatively, there is a Python package named databricks-connect
, as its description said as the figure below, you can try to use it to connect custom applications like flask
to Azure Databricks clusters and run Spark code.
The more details for its usage, you can refer to the offical document Databricks Connect
and the blog Databricks-Connect - FINALLY!
.
Hope it helps.
Upvotes: 2