0

I have a function app (python) in the azure portal which is in python version 3.7. The FUNCTIONS_EXTENSION_VERSION of the function app is ~3. When I deploy the function python) from VS code to update the function in the portal, I'm able to deploy and the update is reflected in the azure portal.

But when I change the python version to 3.9 and update FUNCTIONS_EXTENSION_VERSION to ~4 in the Azure portal and try to deploy the function(python) from VS code to update the function in the portal, deployment failed with error "deployer = ms-azuretools-vscode deploymentPath = Functions App ZipDeploy. Extract zip. Remote build."

The deployment is failing only after upgrading to version 3.9.

Could anyone please help me to understand why am I getting this error and how can we fix this?

1
  • have you tried with py3.8? Commented Nov 25, 2022 at 12:44

1 Answer 1

0

To upgrade the Python Version 3.7 to 3.9

Step 1: Update FUNCTIONS_EXTENSION_VERSION to 4 and Python version of Azure Function App in the Portal using the cmdlet:

az functionapp config set --name krishpyfunapp37to39 --resource-group HariTestRG --linux-fx-version "PYTHON|3.9"

enter image description here enter image description here

Make Sure Runtime Version is 4 in the General Settings of the Azure Function App Configuration Menu.

Step 2:

Select the Python Interpreter as 3.9.x version in your Azure Functions Project using the VS Code IDE: (Ctrl + Shift + P and Type as "Python Interpreter")

enter image description here

If the Virtual Environment is activated in the project, make sure you update the home path and version number in virtual environment folder of the project:

home = C:\Users\Hari\AppData\Local\Programs\Python\Python39
include-system-site-packages = false
version = 3.9.13

enter image description here

Note: Update the code and packages that matches the Python version 3.9.x when upgrading/downgrading > Test and then deploy. So that, it will not break the code due to changes.

enter image description here

Refer to this MS Doc for steps on migrating the Azure Functions versions 3.x to 4.x and Python Versions.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.