When I publish my azure cloud functions I get the message:
Local python version '3.9.7' is different from the version expected for your deployed Function App. This may result in 'ModuleNotFound' errors in Azure Functions. Please create a Python Function App for version 3.9 or change the virtual environment on your local machine to match 'Python|3.8'.
How can I change the version to 3.9?
linuxFxVersion from the Azure CLI.linuxFxVersion setting in the function app.az functionapp config set --name <FUNCTION_APP> \
--resource-group <RESOURCE_GROUP> \
--linux-fx-version "PYTHON|3.9"
Please refer Changing Python version for more information.
For those of you facing the following error when attempting the solution provided by Harshitha:
'3.9' is not recognized as an internal or external command,
operable program or batch file.
This is because '|' needs to be escaped within the string "PYTHON|3.9" to work in PowerShell. This will work:
'Python"|"3.9'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With