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:
- Use Python 3.7
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
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
- Publish Artifact: drop, Path to publish: $(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip
dotnet build
are not in the right place. You can visithttps://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