Unable to connect to Azure Databricks SQL from Azure functions endpoint on Azure portal

Binoy Kanchanwala 0 Reputation points
2023-07-21T18:56:29.24+00:00

Hello,

I have developed Azure Function project library using VS 2022. I am accessing a table in Azure Databricks SQL via Apach Spark ODBC driver connection settings. I am able to connect to table and run the HTTP function endpoint locally (e.g. localhost). But after publishing to Azure portal the function endpoint returns "HTTP ERROR 500". It says

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,398 questions
Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,326 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Saurabh Sharma 23,826 Reputation points Microsoft Employee
    2023-07-31T19:39:32.1866667+00:00

    Hi @Binoy Kanchanwala ,

    Sorry for delay on this one. As mentioned in this Q&A thread, it is not possible to install ODBC driver due to the function due to the functions sandbox limitation and you could use Windows Containers on Azure App service in which you have control over what drivers or custom to install.

    Also, to run Functions inside the container you can use the following Windows Container for Azure Functions v3 : mcr.microsoft.com/azure-functions/dotnet:3.0-nanoserver-1809 and run it App Service: Run a custom container in Azure.

    Alternatively, you can use Databricks SQL Statement Execution REST API to write the results to an Azure storage and then access it in your function app.

    Hope this helps.

    Thanks

    Saurabh


    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.