A.k.a. “you’ve got to be fucking kidding me”. Azure App Service sucks, as basically any part of Azure. What’s surprising this time is that terraform actually contributes to the sucking on this occasion - usually the Hashi folks do a very good job at reducing the annoyance. But maybe they’ve given up, I wouldn’t blame them.
So what happened?
What confused the sh*t out of me the last days is that I see tutorials (all really, really, really bad) that do use Python versions newer than 3.4 (not surprisingly). But, alas, there’s this: the
site_config.python_version field of terraform’s
azurerm_app_service resource. It allows the values “2.7” and “3.4” (a Python version which eol’ed in March ‘19).
After a shit ton of googling I found this, though. Turns out, it’s not even the right field to use!! To select the Python runtime you should use
linux_fx_version, which nobody, nowhere, ever documented. And naive me just assumed that something with “python” in its name would be the right thing to use. Stupid, I know, we’re talking Azure here …