7

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?

0

3 Answers 3

12
  • You can view and set the linuxFxVersion from the Azure CLI.
  • With the az functionapp config set command, you can change the 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.

2
  • 1
    I have the same issue, but I do not have the permission to update config(to python3.9). So I try to install python3.7. And run deployment with func azure functionapp publish <func_name> --publish-local-settings -i --overwrite-settings -y --python. Same error occurred. I also got this error message "Unexpected character encountered while parsing value: {. Path '[0].build_summary', line 1, position 663." Any suggestions?
    – han shih
    May 24, 2022 at 8:57
  • 1
    I'm getting '3.9' is not recognized as an internal or external command, operable program or batch file. Dec 6, 2022 at 12:07
3

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'

1
  • Tried all escaping methods but command is not recognized. Any other ways to update the version? May 22 at 15:09
0

You can change it from General Settings under App config enter image description here

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Nov 9 at 12:42

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.