Deploying Python Function App using Azure CLI

Raghul Kannan 191 Reputation points
2022-11-09T06:43:01.4+00:00

When I try to deploy a python function app I get the following error. The issue is specific to python app deployment only, deploying .net core apps work fine.

Getting site publishing info...
Creating archive for current directory...
Performing remote build for functions project.
Deleting the old .python_packages directory
Uploading 3.29 KB [###############################################################################]
Remote build in progress, please wait...
Updating submodules.
Preparing deployment for commit id 'c15859b3-6'.
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 /tmp/build/expressbuild --platform python --platform-version 3.6.15 -i /tmp/8dac21d09c0e012 -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.20220812.1, Commit: cdf6b1bef165d05b94830e963646495967d938f4, ReleaseTagName: 20220812.1

Build Operation ID: |ZsD8ThMzWJ0=.fd9457b6_
Repository Commit : c15859b3-6c02-4fea-9a0d-e97c4b46019e

Detecting platforms...
Error: Oops... An unexpected error has occurred.
Error: Oops... An unexpected error has occurred.\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /tmp/build/expressbuild --platform python --platform-version 3.6.15 -i /tmp/8dac21d09c0e012 -p packagedir=.python_packages/lib/site-packages

Generating summary of Oryx build
Deployment Log file does not exist in /tmp/oryx-build.log
The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
Deployment Failed. deployer = Push-Deployer deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
Remote build failed!

I followed the exact steps in https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-cli-python?tabs=azure-cli%2Cpowershell&pivots=python-mode-configuration

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

Accepted answer
  1. VenkateshDodda-MSFT 24,951 Reputation points Microsoft Employee Moderator
    2022-11-10T11:43:50.33+00:00

    @Raghul Kannan Thanks for your cooperation and patience on this. Upon troubleshooting we understood that the issue with the "FUNCTIONS_WORKER_RUNTIME" because of this function host went unreachable. Suggested the below cmdlet to pin the function worker runtime to Python|3.8 and it fixed the customer issue.

    az functionapp config set --name <FUNCTION_APP> --resource-group <RESOURCE_GROUP> --linux-fx-version "PYTHON|3.8"  
    

    Feel free to reach back to me if you have any questions on this,

    1 person found this answer helpful.

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.