I am trying to deploy an application on Azure App Service. I have created a deployment with Python 3.9.7
, but my app needs Python 3.9.12
. How do I upgrade python’s version?
In Azure App Service > Configuration > General Settings > Python minor version, there is no 3.9.12 available. So I have to upgrade it by SSH. But, I don’t understand Linux.
Can anyone tell me a command to upgrade my python version to 3.9.12 using bash?
2
Answers
Created the Python Web App from the Azure Portal with the version 3.9 and shown as 3.9.7 in the SSH Console.
In the Configuration, it shown me only these versions in minor and major dropdown lists:
Using this Azure CLI cmdlet
az webapp config set ...
, I have set the Python version from3.9.7
to3.9.12
but not reflected specifically like3.9.X
in the SSH Console. It is showing the current python version of that web app with theaz webapp config show
cmdlet:Result:
Using the portal/blessed images(available images) you cannot upgrade your webapp runtime to particular python minor version.
Currently available minor python versions that can be deployed from portal are 3.7.12,3.8.12,3.9.7,3.10.4.
If you want to run a particular runtime minor version (python 3.9.12) in your web app it is always recommended to use custom docker image using that you can run the unsupported versions as well as mentioned in this documentation.
Here is the reference documentation to create custom docker container on Azure app service which has sample Dockerfile as well.
Refer to this Docker Hub registry for python images and select a particular image based on your requirement.
Note: I have looked at the official docker hub registry for python as well unfortunately we do not have any image that support v3.9.12 we have images for V3.9.15.