Ben
Ben

Reputation: 61

Azure WebApp not finding ODBC Driver

I am running an app service on Azure which is connected to an Azure SQL database. I have used the same configuration for over 2 years with similar apps and have had no problems. Up until 2 days ago, this app was working without problems as well.

Now, I am getting the error

sqlalchemy.exc.DBAPIError: (pyodbc.Error) ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)")

I have tried drivers 13 and 18 as well as FreeTDS and get the same error. Please advise on a fix. This app is currently in production and experiencing downtime because of the issue. The app works locally but not on the cloud. It is a pure code app (I don't upload a container).

Upvotes: 1

Views: 687

Answers (1)

Ben
Ben

Reputation: 61

I have been informed by Azure support that the problem is a known platform issue that came up after the Antares 99 upgrade. They're working on a solution but as a (temporary) they suggest adding a startup script with

#!/bin/bash
apt-get update
apt-get install -y unixodbc-dev
ACCEPT_EULA=Y apt-get install msodbcsql17
<startup command to launch your application>

This has got the application up and running again.

Upvotes: 2

Related Questions