Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.94k stars 441 forks source link

Errors in new programming model can cause functions to no longer be listed #9941

Open joechung-msft opened 7 months ago

joechung-msft commented 7 months ago

Check for a solution in the Azure portal

For issues in production, please check for a solution to common issues in the Azure portal before opening a bug. In the Azure portal, navigate to your function app, select Diagnose and solve problems from the left, and view relevant dashboards before opening your issue.

Investigative information

Please provide the following:

Repro steps

Provide the steps required to reproduce the problem:

  1. Create a Python Function App in East US with a Consumption plan.
  2. Create an HTTP trigger function in this app (with default name and authorization level).
  3. Edit the function using the Code + Test editor in such a way as to introduce a syntax error.
  4. Save the function.
  5. Go back to the function app overview.

Expected behavior

The HTTP trigger function should be listed in the Functions tab.

Actual behavior

The HTTP trigger function is no longer listed in the Functions tab. There is no indication of why there are no longer any functions being listed.

Known workarounds

Fix the syntax error:

Additional context

In this simplified repro, it is possible to fix the error. Generally speaking, however, one or more errors may cause the list of functions to be empty with no easy way to (a) know what errors there were and (b) navigate to the files with issues and correct those errors.

The Azure portal depends on function metadata being available so it can present a list of functions and a code editor and configuration management experience for each function. However, in the new programming models where configuration is stored with the code, errors which cause failures when processing the function metadata stored there can cause the function metadata to become unavailable, resulting in a significantly degraded portal editing and management experience.

The impact is not limited to the Azure portal. Once an error has occurred which causes the function metadata to become unavailable, Azure CLI and REST API operations will also be impacted.

fabiocav commented 7 months ago

@joechung-msft the desired behavior listed here may not be feasible, as the host won't know anything about the functions in the app.

We need to define a flow that enables the host to return worker provided indexing failure details to ensure those are surfaced.