1

I am using VS code and Azure functions extension to create and deploy a python HTTP trigger azure function.

The problem I am having is that when I include a git repository to the requirements.txt the deployment fails without clear error. As soon as I remove the reference the deployment is successfull.

The requirements.txt:

azure-functions
numpy
git+https://github.com/my/3rdPartyRepo.git@main

Using the azure function tools for VS code I get the following message when failing:

22:04:41 MyFunctionApp: Generating summary of Oryx build 22:04:41 MyFunctionApp: Deployment Log file does not exist in /tmp/oryx-build.log 22:04:41 MyFunctionApp: The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build 22:04:41 MyFunctionApp: Deployment Failed. deployer = ms-azuretools-vscode deploymentPath = Functions App ZipDeploy. Extract zip. Remote build. 22:05:07 MyFunctionApp: Deployment failed.

Using the command to deploy a zip file:

az functionapp deployment source config-zip -g dev-myapp -n myfunctionAppInAzureName --src myfunctionApp.zip --build-remote

Gives me this error

Zip deployment failed. {'id': '3811f2d3-73f1-423d-ad6e-81e7f6125c3d', 'status': 3, 'status_text': '', 'author_email': 'N/A', 'author': 'N/A', 'deployer': 'Push-Deployer', 'message': 'Created via a push deployment', 'progress': '', 'received_time': '2023-01-01T18:36:05.0549119Z', 'start_time': '2023-01-01T18:36:06.0940945Z', 'end_time': '2023-01-01T18:36:42.9062073Z', 'last_success_end_time': None, 'complete': True, 'active': False, 'is_temp': False, 'is_readonly': True, 'url': 'https://myfunctionAppInAzureName.scm.azurewebsites.net/api/deployments/latest', 'log_url': 'https://myfunctionAppInAzureName.scm.azurewebsites.net/api/deployments/latest/log', 'site_name': 'myfunctionAppInAzureName'}. Please run the command az webapp log deployment show -n myfunctionAppInAzureName -g dev-myapp

When opening the https://myfunctionAppInAzureName.scm.azurewebsites.net/api/deployments/latest it displays there are no latest deployments.

If opening https://myfunctionAppInAzureName.scm.azurewebsites.net/api/deployments/latest/log' it displays there are not latest logs.

I have tried to delete the function app in azure and recreate and then try the same steps. Tried again deleting and recreating running in reverse. Tried changing python version from 3.8 to 3.9.

The option to install the package via git is the recommended one by the owner of the git repository and the pip command installs package without any issues.

What could I do to fix the issue? What can I do to see the real errors here as to why is it happening?

vsarunov
  • 1,433
  • 14
  • 26
  • The issue was that the `Consumption` based plan on azure function does not provide enough memory for this package to be installed. As soon as I switched to premium plan it worked like charm. – vsarunov Jan 06 '23 at 17:31

1 Answers1

0

AFAIK,

pip install git+ssh://github.com/my/3rdPartyRepo.git
  • You have to give the permission "Allow install" for the code package present in Git repository.
  • Using Azure DevOps or GitHub Actions, Setup the Continuous Integration/Deployment Pipeline that does the functionality of triggering whenever a pull request made in the GitHub Master branch and in Azure functions code, copy the required python modules/libraries.

If it is a private git repository, then it needs to be authenticated with the credentials and also to know the process of installing the packages using pip from a public and private GitHub repositories, refer to this SO Q&A 4830856 proposed by @Michael.

Updated Answer:

Glad @vsarunov that you identified and solved the issue by changing the Azure Functions Hosting Plan model from Consumption Plan to Premium Plan because of more memory required for the packages to be installed in the project.

  • 1
    Good suggestion about permissions, but this was not the issue. I answered my question in the comment. – vsarunov Jan 06 '23 at 17:31