[FEATURE] Make startup failures more transparent in Azure
What problem would the feature you're requesting solve? Please describe.
Startup failures have always felt needlessly hard to troubleshot in deployed functions. In particular trying to implement eager settings validation is a pain as it's not readily apparent why the startup fails even when there's a very clear exception message. Currently these exceptions are hidden in some troubleshooting page with no clear indication that an error has ocurred outside of that page.
Describe the solution you'd like
Whenever a startup exception happens the overview page should make it obvious that there's been an error, possibly including a message indicating that an exception has happened with a link to see the full details.
Additional context
Here's a sample view of how such startup failure looks right now. Just an empty function app without any indication that a failure has ocurred.
@ManelBH have you enable logging? Such as application insights? That will include some failures.
@ManelBH have you enable logging? Such as application insights? That will include some failures.
All I can see in application insights are traces saying "No job functions found....". I can't see any exceptions.
Besides it doesn't address the problem I was talking about, looking at the screenshot it's not clear there's been a problem or what are we looking for.
This has to happen because Azure functions have become a finicky piece of shit that like to fail randomly for no apparent reason
All I can see in application insights are traces saying "No job functions found....". I can't see any exceptions.
@ManelBH this can have many different causes, and it might be no actual failure on the part of the host. If your deployment contains no actual functions, be it an authoring or packaging error, the host doesn't know what it doesn't know. It won't know you meant to include functions but didn't have them packaged correctly.
Have you tried running the function app locally? Do your function triggers appear there?
All I can see in application insights are traces saying "No job functions found....". I can't see any exceptions.
@ManelBH this can have many different causes, and it might be no actual failure on the part of the host. If your deployment contains no actual functions, be it an authoring or packaging error, the host doesn't know what it doesn't know. It won't know you meant to include functions but didn't have them packaged correctly.
Have you tried running the function app locally? Do your function triggers appear there?
I already explained the cause in my particular example, my code is throwing an Exception during startup, this happens when there's some invalid settings and it's intended. Running locally I'll immediately see the exception message and know what's wrong.
And in a more general sense I'd like to know, at the very least, about any exception thrown by my code which is preventing the Function App from starting for whatever reason.
Surely the host runtime works as any other program and at some point executes that startup code and receives the error message.
@ManelBH, with out of proc workers, the customer's application is a black box to the host. In general, the customer is responsible for instrumenting their worker. https://learn.microsoft.com/en-us/azure/azure-functions/configure-monitoring?tabs=v2
that an exception has happened with a link to see the full details.
We expose what we can, but worker app failures flowing back to the host are very limited as it is a process boundary. We encourage customers to instrument their own applications for a better experience.
All I can see in application insights are traces saying "No job functions found....". I can't see any exceptions.
There are no errors at all in app insights? If you have app insights enabled in functions, and the proper config setup for it, we will report errors when the worker app fails to start. We also will capture stderr from the worker app and report that (if it is available).
Additionally, we are working on adding health checks to the host. These checks will initially require app insights (or some OTel sink) to be exposed. But connecting them directly to the Functions app page in the Azure portal is a goal of ours. No ETA or details on how that will work yet.
I'm a bit confused by the answer, either this is by design, and hence the feature request, or I was supposed to get those logs and I would turn this into a bug report.