I'm currently creating a build pipeline in BitBucket, to move away from our current 'Right Click -> Publish' strategy. I've migrated some of our functions which are hosted on Windows, no problem. We have one function on a Linux app service plan, and unfortunately after publishing it fails to run from the package.
# Publish to a folder
dotnet publish "azure/$FUNCTION_NAME/$FUNCTION_NAME.csproj" -c Release -o publish/$FUNCTION_NAME
# Create a zip file
md artifacts
powershell Compress-Archive publish/$FUNCTION_NAME/** artifacts/$FUNCTION_NAME.zip
# Deploy the zip file to Azure
az functionapp deploy -g $AZURE_RESOURCE_GROUP -n $AZURE_RESOURCE_NAME --src-path artifacts/$FUNCTION_NAME.zip
This is pretty much exactly the steps listed on the Azure Functions documentation page. When publishing to Linux, there are no errors, it just does nothing. In the Azure Portal, all the functions in the app are still listed and the host.json and function.json files seem to be recognized, but I can no longer test/run the function. Every request to the HTTP endpoints returns a 404 status.
I've tried to look through the logs, I'm a bit lost without a UI but I did find these messages:
/home/LogFiles/kudu/deployment/5fd0c28b328b-ec52daf9-7903-466a-bfe1-5c1c658ab72b.txt
::::::::::::::
5fd0c28b328b-ec52daf9-7903-466a-bfe1-5c1c658ab72b.txt
::::::::::::::
2022-05-02T01:41:14 Fetching changes.
2022-05-02T01:41:30 Updating submodules.
2022-05-02T01:41:31 Preparing deployment for commit id '35555aaa-2'.
2022-05-02T01:41:32 Skipping build. Project type: Run-From-Zip
2022-05-02T01:41:32 Skipping post build. Project type: Run-From-Zip
2022-05-02T01:41:32 Requesting site restart
2022-05-02T01:41:33 Requesting site restart. Attempt #1
2022-05-02T01:41:33 Successfully requested a restart. Attempt #1
2022-05-02T01:41:34 Updating /home/data/SitePackages/packagename.txt with deployment 20220502014112.zip
2022-05-02T01:41:35 Deployment successful.
2022-05-02T01:41:38 An unknown error has occurred. Check the diagnostic log for details.
2022-05-02T02-02-31Z-ff1a2fe5e9.log
2022-05-02T02:02:31.309 [Warning] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
Re-publishing from within Visual Studio fixes the problem, so it's definitely an issue with how I am publishing. The publish profile within Visual Studio has a <IsLinux>true</IsLinux> property, which I suspect is what I need to somehow specify for the Azure CLI as well.
az functionapp deployment source config-zip -g <resource_group> -n \ <app_name> --src <zip_file_path>as per official documentation!az functionapp deployis also valid. I've tried both, and confirmed that both work when using the zip file produced by Visual Studio's 'Right-click -> Publish'