admin管理员组

文章数量:1122846

I have Azure function app which is deployed via pipeline in Azure DevOps. Deployment completes without any issues, but when I navigate to my app in Azure portal, on Overview page I get error message Microsoft.Azure.WebJobs.Script: WorkerConfig for runtime: python not found. Runtime version displays Error, instead of Python version.

What I've done:

  1. In deployment pipeline I'm setting the Python version as follows:
az functionapp config set --name ${{ parameters.pyFuncAppName }} \ 
--resource-group ${{ parameters.resourceGroupName }} \
--linux-fx-version 'Python|3.10'
  1. Check App configuration in Configuration -> General settings.
  • On Stack settings I have Stack = Python
  • Python Version is 3.10.
  1. SSH into App host
  • python --version gives Python 3.10.15
  1. SSH into Kudu SSH
  • python command not found
  • python3 --version gives Python 3.9.2 <-- is this the root of the issue?

Unfortunately this is a client project and everything is extremely sensitive so I cannot publish pipeline code or function app code but I'm happy to provide clarification if needed.

I have Azure function app which is deployed via pipeline in Azure DevOps. Deployment completes without any issues, but when I navigate to my app in Azure portal, on Overview page I get error message Microsoft.Azure.WebJobs.Script: WorkerConfig for runtime: python not found. Runtime version displays Error, instead of Python version.

What I've done:

  1. In deployment pipeline I'm setting the Python version as follows:
az functionapp config set --name ${{ parameters.pyFuncAppName }} \ 
--resource-group ${{ parameters.resourceGroupName }} \
--linux-fx-version 'Python|3.10'
  1. Check App configuration in Configuration -> General settings.
  • On Stack settings I have Stack = Python
  • Python Version is 3.10.
  1. SSH into App host
  • python --version gives Python 3.10.15
  1. SSH into Kudu SSH
  • python command not found
  • python3 --version gives Python 3.9.2 <-- is this the root of the issue?

Unfortunately this is a client project and everything is extremely sensitive so I cannot publish pipeline code or function app code but I'm happy to provide clarification if needed.

Share Improve this question edited Nov 22, 2024 at 9:54 Kilipukki asked Nov 22, 2024 at 9:25 KilipukkiKilipukki 3936 silver badges17 bronze badges 3
  • Did you try with other versions? – Pravallika KV Commented Nov 22, 2024 at 10:26
  • The python3 version was 3.9.2 in Kudo site (BASH) even if I newly created a function app with a python stack of 3.10. Your app should not be running in Kudo container and this behavior may not be relevant. Besides, it didn't seem to be the issue of the az functionapp config se command, either, I ran the same command with different --linux-fx-version of 'Python|3.10' and 'Python|3.11'in Cloud shell; the versions were updated in both app configuration web UI and in the host (SSH) site. – Alvin Zhao - MSFT Commented Nov 25, 2024 at 6:32
  • With those being said, we lacked the information about how the issue was reproduced. You may try build -> set -> deploy your app without pipelines to at least isolate the cause of the issue by the deployment tool or the code itself. Was there any succeeded deployment before, no matter manual deployment from local machine or via pipelines? Was there any change between the two deployments? Will the issue persist if you deploy a simple hello-world app? – Alvin Zhao - MSFT Commented Nov 25, 2024 at 6:33
Add a comment  | 

1 Answer 1

Reset to default 0

I have created a Python Azure function app with runtime stack Python 3.10. Refer the blog.

Tested the Python version in KUDU SSH and App Host.

KUDU SSH(Bash):

WEBSSH:

This behavior doesn't affect the function app's performance.

Create Virtual environment with required Python version.

pyvenv.cfg:

home = C:\Users\uname\AppData\Local\Programs\Python\Python310
include-system-site-packages = false
version = 3.10.9
executable = C:\Users\uname\AppData\Local\Programs\Python\Python310\python.exe
command = C:\Users\uname\AppData\Local\Programs\Python\Python310\python.exe -m venv C:\Users\uname\pyfn\env

Add Functions_Worker_Runtime= Python in Azure FunctionApp=>Settings=>Environment Variables:

Deploy the function to Azure:

Portal:

本文标签: Azure Functions MicrosoftAzureWebJobsScript WorkerConfig for runtime python not foundStack Overflow