I have a Python webapp deployed on Azure App Service (supposedly a simple way to deploy a webapp). I want it to write to a SQL database (Azure SQL). That's it.
This led me down a rabbit-hole. The support for this use-case is abysmal!
- To write to a database, I need
pyodbc
. - To install
pyodbc
I needgcc
on Linux because it needs to compile (no wheels available). - Azure App Service (for Linux; App Service for Windows with a Python runtime is deprecated) does not include
gcc
, so I have to use a custom container which means:- Writing a
Dockerfile
- and spinning up a private Azure Container Registry (and configuring credentials; service principals don't work because I don't have permissions to Azure AD in my subscription).
- Writing a
This seems unfathomably complicated. I just want my web app to write to a database. Is there a simpler way to achieve this on Azure App Service/Python?