Azure / azure-functions-dotnet-worker

Azure Functions out-of-process .NET language worker
MIT License
428 stars 182 forks source link

Flex Consumption simple app has 'no functions found' intermittently #2679

Open nzthiago opened 2 months ago

nzthiago commented 2 months ago

Description

Customer reports that they were testing a dotnet-isolated Flex Consumption app in Australia East, with the default template that core tools creates. Core Tools version 4.0.5907.

They created a .NET 8 Isolated Flex Consumption app called fjhskljfsdalkfjsd using the Azure Portal in Australia East. Then from the command line ran:

func init MyProjFolder --worker-runtime dotnet-isolated 
cd MyProjFolder
func new --template "Http Trigger" --name MyHttpTrigger

Then published to their app:

func azure functionapp publish fjhskljfsdalkfjsd

They then observed "No HTTP triggers found" at the end of publishing, and no functions showing on the portal: image

They then created two or three more new dotnet isolated Flex Consumption apps and repeating this process, all failed with the same results. I couldn't repro, tried the same steps in Australia East. They reported later that the exact same steps worked for them fine, which seems to point to a temporary issue that we should track down.

I had a look and there was really something going on with that app for a while:

let _appName = 'fjhskljfsdalkfjsd';
let _startTime = datetime(2024-08-28T15:09:00Z);
let _endTime = datetime(2024-08-30T15:09:00Z);
FunctionsLogs
| where PreciseTimeStamp between (_startTime.._endTime)
| where isempty(_appName) or AppName =~ _appName
| where Level < 4
| project-reorder PreciseTimeStamp, AppName, RoleInstance, Summary, EventName, Source, FunctionName, FunctionInvocationId, HostInstanceId, ActivityId, MachineName, EventPrimaryStampName, Tenant, Level 

Namely: Source: Microsoft.Azure.WebJobs.Script.Grpc.FunctionRpcService Summary : Exception encountered while listening to EventStream Start of stack trace: System.IO.IOException : The request stream was aborted. ---> Microsoft.AspNetCore.Connections.ConnectionAbortedException : The HTTP/2 connection faulted. End of inner exception at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

Any ideas what could've cause this transient issue with the most basic of apps for just that period of time?

Steps to reproduce

NOTE: the issues seemed transient. I was therefore not able to reproduce. Create a .NET 8 Isolated Flex Consumption app using the Azure Portal in Australia East. Then from the command line run:

func init MyProjFolder --worker-runtime dotnet-isolated 
cd MyProjFolder
func new --template "Http Trigger" --name MyHttpTrigger

Then published to their app:

func azure functionapp publish <FUNCTION_APPNAME>
kshyju commented 2 months ago

@nzthiago I looked at the logs for "fjhskljfsdalkfjsd" app. The logs suggests that there was no app payload present. Can you confirm there was a valid app deployment which was successful?

worker.config.json not found at /home/site/wwwroot/worker.config.json. This may indicate missing app payload.

nzthiago commented 2 months ago

Their steps were to create the app in the portal, and then deploy the app using core tools. So in that period between creating the app in the portal, and deploying the app, yes I think the app payload would not be there indeed. But what they observed is that after deployment of the payload the portal would still report no functions. But a few hours later, that behavior did not repro. Are you able to check the time between app creation via the portal, and when the app content was deployed? worker.config.json shouldn't show up after the deployment I hope.