Azure / azure-functions-python-worker

Python worker for Azure Functions.
http://aka.ms/azurefunctions
MIT License
335 stars 103 forks source link

Error on first deploy to Azure Functions and not deployed. #1573

Open Shotaro-Yoshinaga-sti opened 3 weeks ago

Shotaro-Yoshinaga-sti commented 3 weeks ago

Version

Python: 3.11 Core tools: 4.0.5907

Description

The following error occurs during the first deploy to Azure Functions and it is not deployed. Execute the same command again and the deployment will succeed.

First deployment

$ func azure functionapp publish func-test
Local python version '3.8.10' 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.8 or change the virtual environment on your local machine to match 'Python|3.11'.
Getting site publishing info...
[2024-09-04T10:09:33.768Z] Starting the function app deployment...
Removing WEBSITE_CONTENTAZUREFILECONNECTIONSTRING app setting.
Removing WEBSITE_CONTENTSHARE app setting.
Creating archive for current directory...
Performing remote build for functions project.
Deleting the old .python_packages directory
Uploading 1.3 KB [################################################################################]
Remote build in progress, please wait...
Sequence contains no elements
$

Second deployment

$ func azure functionapp publish func-test
Local python version '3.8.10' 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.8 or change the virtual environment on your local machine to match 'Python|3.11'.
Getting site publishing info...
[2024-09-04T10:09:33.768Z] Starting the function app deployment...
Creating archive for current directory...
Performing remote build for functions project.
Deleting the old .python_packages directory
Uploading 1.3 KB [################################################################################]
Remote build in progress, please wait...
Updating submodules.
Preparing deployment for commit id '6b8baeb5-1'.
PreDeployment: context.CleanOutputPath False
PreDeployment: context.OutputPath /home/site/wwwroot
Repository path is /tmp/zipdeploy/extracted
Running oryx build...
Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.11 -p packagedir=.python_packages/lib/site-packages
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20230210.1, Commit: a49c8f6b8abbe95b4356552c4c884dea7fd0d86e, ReleaseTagName: 20230210.1

Build Operation ID: 1aa8c03afbb27e30
Repository Commit : 6b8baeb5-1733-418b-a1e3-493df532aef4
OS Type           : bullseye
Image Type        : githubactions

Detecting platforms...
Detected following platforms:
  python: 3.11.8
Version '3.11.8' of platform 'python' is not installed. Generating script to install it...

Source directory     : /tmp/zipdeploy/extracted
Destination directory: /home/site/wwwroot

Downloading and extracting 'python' version '3.11.8' to '/tmp/oryx/platforms/python/3.11.8'...
Detected image debian flavor: bullseye.
Downloaded in 1 sec(s).
Verifying checksum...
Extracting contents...
performing sha512 checksum for: python...
Done in 8 sec(s).

image detector file exists, platform is python..
OS detector file exists, OS is bullseye..
Python Version: /tmp/oryx/platforms/python/3.11.8/bin/python3.11
Creating directory for command manifest file if it does not exist
Removing existing manifest file

Running pip install...
Done in 22 sec(s).

...

Creating placeholder blob for linux consumption function app...
SCM_RUN_FROM_PACKAGE placeholder blob scm-latest-func-test.zip located
Uploading built content /home/site/artifacts/functionappartifact.squashfs for linux consumption function app...
Resetting all workers for func-test.azurewebsites.net
Deployment successful. deployer = Push-Deployer deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
Remote build succeeded!
[2024-09-04T10:16:23.626Z] Syncing triggers...
Functions in func-test:
    test - [httpTrigger]
        Invoke url: https://func-test.azurewebsites.net/api/test
$

Steps to reproduce

Deploy locally using Core tools.

bhagyshricompany commented 2 weeks ago

Hi @Shotaro-Yoshinaga-sti Thanks for reporting will check and update you.