I'm trying to run a Django (3.0) app on Azure App Service in Linux, connected to an Azure SQL Database. In my staging App Service instance, this works perfectly, however, when I set up my production instance on a different Azure account, my Django app can no longer access the database.
When I hardcoded the ODBC Driver 17 into database settings, I got this error in my Oryx build logs:
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)")
When I switched to the non-hardcoded version suggested here, I got this error:
'driver': sorted(pyodbc.drivers()).pop(),
IndexError: pop from empty list
How does one go about installing an ODBC Driver on Azure App Service?
EDIT: I am not using the Docker deploy option. I am deploying source code directly from Github.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…