3

I'm developing Azure Functions using Python 3.10.10 on my machine, deploying the Function through Azure DevOps which is building the artifact using Python 3.6.8, and the Python Version shown for the Function App host is 3.8.

There was a recent update of Azure Functions Runtime which deprecated Python 3.6. (see breaking changes here).

How does python version affect Azure Functions? How do we keep the versions aligned?

ericOnline
  • 1,586
  • 1
  • 19
  • 54
  • 1
    One thing that could help is to specify the python version in your requirements.txt file (something like `python==3.8`). In general, it's a good idea to have your development, deployment, and host environments use the same version of python if possible. As to the specifics beyond that, I'm not experienced enough with Azure to say more. – Plonetheus Mar 01 '23 at 21:09

1 Answers1

2
  • Alignment

Always keep in Azure DevOps a version of python venv that matches the App host and also keep the same dependencies within a requirements.txt file so that you don't have conflicts from different libraries.

On your local you should also have a python venv that matches the same version of the host. I would suggest to downgrade from your current 3.10.10 to 3.8.x just to avoid having conflicts.

  • Python version

Python version per se shouldn't generally affect functionality (unless there are big changes between minor versions), it's usually the library dependencies that are breaking the functionalities (deprecation and implementations of methods in different way)

Mache
  • 106
  • 1
  • 3
  • 8
  • Thank you. So you are saying all three Python versions (local, ADO and Host) should all be the same. But its not really a problem unless some big version changes or library changes break some functionality. Hm...I wish there was more built-in alignment or some documentation on why / when this is important. – SeaDude Mar 03 '23 at 02:26
  • 2
    The _ideal_ way of working would be to have major.minor (e.g. 3.8) version combinations on all environments (local, build/jenkins, application target). The best way (as mentioned above) is to have that `requirements.txt` file to _force_ the libraries to match from your build until the target. In that way you can control which libraries you want to update and when. – Mache Mar 03 '23 at 13:50