Error while deploying Python Function to Function App using VS Code

Domagoj Bazina 201 Reputation points
2022-06-01T12:35:28.777+00:00

Hello,
I'm experiencing issues while deploying python Function (using VS Code) to "premade" Function App (Created using Azure Portal).
I'm using Azure Free Student Subscription. I have tried to deploy NodeJS application in the same way, it worked normally.
I've tested Python 3.8 version, it doesn't work.
When I create Function App (without premade Azure Portal Function App) & Function using VS Code, everything works okay.

Here you can see Function App Configuration:

207559-azure-portal-review.png

These are the steps, that I've done in VS Code:

  1. VS Code
    Workspace - Create Function
    Select a language - Python
    Select a Python interpreter... - Python 3.9.12
    Template - HTTP trigger
    Name - HttpTrigger1
    Authorization level - Function
  2. VS Code - function folder (HttpTrigger1)
    Right click (Deploy to function App)
    Select a resource - python-test-application (Created using Portal)
    Warning window (Are you sure you want to deploy to "python-test-application... ?) - Deploy

This is the log output:

14:19:12 python-test-application: Starting deployment...
14:19:15 python-test-application: Creating zip package...
14:19:15 python-test-application: Zip package size: 1.68 kB
14:20:02 python-test-application: Fetching changes.
14:20:03 python-test-application: Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/92560a7f-cfea-4b63-a7fb-58668f8b37d4.zip (0.00 MB) to /tmp/zipdeploy/extracted
14:20:05 python-test-application: Updating submodules.
14:20:06 python-test-application: Preparing deployment for commit id '9366654e-1'.
14:20:06 python-test-application: PreDeployment: context.CleanOutputPath False
14:20:06 python-test-application: PreDeployment: context.OutputPath /home/site/wwwroot
14:20:06 python-test-application: Repository path is /tmp/zipdeploy/extracted
14:20:06 python-test-application: Running oryx build...
14:20:06 python-test-application: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.9 -p packagedir=.python_packages/lib/site-packages
14:20:07 python-test-application: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
14:20:07 python-test-application: You can report issues at https://github.com/Microsoft/Oryx/issues
14:20:07 python-test-application: Oryx Version: 0.2.20210120.1, Commit: 66c7820d7df527aaffabd2563a49ad57930999c9, ReleaseTagName: 20210120.1
14:20:07 python-test-application: Build Operation ID: |ObsVWzbA/wM=.415e9627_
14:20:07 python-test-application: Repository Commit : 9366654e-1537-4d7e-bc32-1c4d221a0f88
14:20:07 python-test-application: Detecting platforms...
14:20:07 python-test-application: Detected following platforms:
14:20:07 python-test-application: python: 3.9.7
14:20:07 python-test-application: Version '3.9.7' of platform 'python' is not installed. Generating script to install it...
14:20:08 python-test-application: Source directory : /tmp/zipdeploy/extracted
14:20:08 python-test-application: Destination directory: /home/site/wwwroot
14:20:08 python-test-application: Downloading and extracting 'python' version '3.9.7' to '/tmp/oryx/platforms/python/3.9.7'...
14:20:08 python-test-application: Downloaded in 0 sec(s).
14:20:08 python-test-application: Verifying checksum...
14:20:09 python-test-application: Extracting contents...
14:20:12 python-test-application: Done in 4 sec(s).
14:20:12 python-test-application: Python Version: /tmp/oryx/platforms/python/3.9.7/bin/python3.9
14:20:12 python-test-application: Running pip install...
14:20:13 python-test-application: [12:20:13+0000] Collecting azure-functions
14:20:13 python-test-application: [12:20:13+0000] Downloading azure_functions-1.11.2-py3-none-any.whl (206 kB)
14:20:13 python-test-application: [12:20:13+0000] Installing collected packages: azure-functions
14:20:13 python-test-application: [12:20:13+0000] Successfully installed azure-functions-1.11.2
14:20:13 python-test-application: WARNING: You are using pip version 20.2.3; however, version 22.1.2 is available.
14:20:13 python-test-application: You should consider upgrading via the '/tmp/oryx/platforms/python/3.9.7/bin/python3.9 -m pip install --upgrade pip' command.
14:20:13 python-test-application: Done in 1 sec(s).
14:20:13 python-test-application: Preparing output...
14:20:13 python-test-application: Copying files to destination directory '/home/site/wwwroot'...
14:20:13 python-test-application: Done in 0 sec(s).
14:20:13 python-test-application: Removing existing manifest file
14:20:13 python-test-application: Creating a manifest file...
14:20:13 python-test-application: Manifest file created.
14:20:13 python-test-application: Done in 5 sec(s).
14:20:15 python-test-application: Running post deployment command(s)...
14:20:15 python-test-application: Generating summary of Oryx build
14:20:15 python-test-application: Deployment Log file does not exist in /tmp/oryx-build.log
14:20:15 python-test-application: The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
14:20:15 python-test-application: Triggering recycle (preview mode disabled).
14:20:15 python-test-application: Linux Consumption plan has a 1.5 GB memory limit on a remote build container.
14:20:15 python-test-application: To check our service limit, please visit https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale#service-limits
14:20:15 python-test-application: Creating placeholder blob for linux consumption function app...
14:20:15 python-test-application: Malformed SCM_RUN_FROM_PACKAGE when uploading built content.
14:20:15 python-test-application: Generating summary of Oryx build
14:20:15 python-test-application: Deployment Log file does not exist in /tmp/oryx-build.log
14:20:15 python-test-application: The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
14:20:15 python-test-application: Deployment Failed.
14:19:43 python-test-application: Deployment failed.

Thanks in advance !

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,131 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruno Lucas 4,431 Reputation points MVP
    2022-06-02T10:11:58.763+00:00

    There is a long thread about that here:
    https://stackoverflow.com/questions/62017288/azure-function-deployment-failed-malformed-scm-run-from-package-when-uploading

    The last part of that forum thread makes sense (the one regarding the storage). If you manually create a function, it may spin it's own storage. you may need to do some rewiring inside local settings.json

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.