0
votes

I have followed this documentation: https://docs.microsoft.com/bs-latn-ba/azure/azure-functions/functions-how-to-azure-devops but I get a 500 Internal Server Error when I invoke the function. However, using VSCode I could deploy it using the same code. This error explains how the function can not find the imported libs.

GitHub structure directory:

app-functions/rt-function/HTTPTrigger
app-functions/rt-function/HTTPTriggerStable
app-functions/rt-function/requirements.txt

CI:

  1. Use Python 3.7
  2. Bash Script with inline content:

    cd ./app-functions/rt-function/ if [ -f extensions.csproj ] then dotnet build extensions.csproj --output ./bin fi pip install --target="./.python_packages/lib/site-packages" -r ./requirements.txt

  3. Archive app-functions/rt-function, Root folder or file to archive:app-functions/rt-function and Archive file to create:$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip

  4. Publish Artifact: drop, Path to publish: $(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip
1
I guess the deployment files generated by dotnet build are not in the right place. You can visit https://yourAppName.scm.azurewebsites.net to check if the app files are deployed in the right folder structure. You can aslo compare the folder structure deployed to azure app server via VSCode and that deployed via Azure devops pipeline. So that you will see the difference.Levi Lu-MSFT
The problem was the folder directory where the python_packages files have to be. Everything fine now, thanks for ask.P00LR0CK

1 Answers

0
votes

To make the answer visible to others, I'm summarizing the answer shared in comment:

The root cause for this issue is that folder structure was incorrect.

Reference:

An similar issue here.

Folder structure