Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Hi, this usually happens because the Linux App Service image doesn’t ship with ODBC Driver 18, and anything you install manually doesn’t persist across updates/re-deployments.
On App Service you basically have two reliable options:
-Use a custom container (recommended)
Build your own Docker image based on a Python image.
In the Dockerfile, install the SQL Server ODBC driver and unixODBC, e.g. (Ubuntu example):
--RUN apt-get update && \
apt-get install -y curl gnupg && \
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list \
> /etc/apt/sources.list.d/mssql-release.list && \
apt-get update && \
ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev
Deploy this image to App Service. The driver will then always be there.
-Startup script that installs the driver on each start
Add a startup command (e.g. startup.sh) that installs msodbcsql18 before your app starts.
Set it in App Service under Startup Command.
This works, but slows startup and is more fragile than a custom image.
There’s no supported way today to “bake” the ODBC driver into the built-in Python 3.14 stack itself; you need either a custom container or a startup script that installs the driver every time the app starts.