Closed FinVamp1 closed 5 months ago
Test cases for App Service Build Status
Hi
If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure: https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request
This way we can better track and assist you on this case
Thanks,
Joaquin Vano Azure App Service
Copied from https://github.com/Azure/azure-functions-dotnet-worker/issues/1865
Trying to deploy a .NET 7 Isolated project from git sources using Deployment Center (App Service Build Service). The build succeeds, the log says that all files were successfully created and copied. But the function does not appear in the list of functions and cannot be triggered (the URL returns 404). When downloading the app's contents, the downloaded ZIP-file doesn't contain the binaries, only an empty host.json file.
The issue here is that the Github repro doesn't contain a solution and the logic for the Project file doesn't cover all Functions Project types scenarios.
when you do a deployment without the solution file, it tries to determine the environment by looking at the .csproj file to determine if it is a function app. The code for this is on kudu/Kudu.Core/Infrastructure/FunctionAppHelper.cs at df8349f71bd3c4ea9e153db7d593ffc2eb86f7fb · projectkudu/kudu (github.com) I believe. Since we are looking for "Microsoft.NET.Sdk.Functions" that does not exist in new isolated .NET function apps, I believe we should also be looking for "Microsoft.Azure.Functions.Worker.Sdk" as this is required for .NET isolated apps.
The reason it works when a solution file is present is that we have code on kudu/Kudu.Core/Infrastructure/VsSolutionProject.cs at df8349f71bd3c4ea9e153db7d593ffc2eb86f7fb · projectkudu/kudu (github.com) that looks at the solution file properties and also calls FunctionAppHelper.LooksLikeFunctionApp() that looks for the function runtime version that is always present.
I think the fix is to just add Microsoft.Azure.Functions.Worker.Sdk to the check below along with the Microsoft.NET.Sdk.Functions and it should work correctly when there is only a .csproj file.
Thanks to Paul Yuknewicz and Eamon O'Reilly for the help on this issue and analysis and also to @scale-tone for the help in reproducting and raising this..