-
Notifications
You must be signed in to change notification settings - Fork 61
Description
Category: Developer Experience / Observability
Description:
There is a critical "Catch-22" in the Azure Portal for Static Web Apps (SWA) with Managed Functions. When a Managed Function fails to initialize or is not correctly detected by the portal UI, it is impossible for a developer to find the root cause.
The Problem:
Detection Failure: The Azure Portal lists "0 Functions" or shows the message "Add a function to your app to enable App Insights".
Hidden Errors: Even though the UI says no functions exist, the "Diagnostics and Solve Problems" blade (Availability and Performance) clearly reports "Backend Errors" (e.g., HTTP 5xx). This proves the platform is attempting to execute functions, but they are failing.
Circular Block: Because the portal UI doesn't "see" the functions, it hides/blocks the Application Insights configuration and the Monitor tab.
Result: The developer is completely blind. There is no Log Stream, no Exception Trace, and no way to enable monitoring because the UI thinks there is nothing to monitor—even though the backend is actively logging errors.
Steps to Reproduce:
Deploy a SWA with Managed Functions via GitHub Actions (Deployment reports success).
Functions fail to index in the Azure Portal (due to a host.json error, runtime mismatch, or startup crash).
Navigate to Application Insights in the SWA menu.
Observed Behavior: The UI says "Add a function to enable App Insights" and provides no way to link a workspace or see existing logs.
Navigate to Diagnostics.
Observed Behavior: The platform shows "Backend Errors", but clicking them provides no stack trace or log output.
Expected Behavior:
Developers must have access to platform-level logs or a raw Log Stream for Managed Functions at all times, especially when they fail to start. The availability of monitoring tools should not be dependent on a "successful" indexing of functions by the Portal UI.
Environment:
Tier: Free or Standard (Issue persists in both)
Runtime: Nodejs
Region: West Europe
Additional Context:
This creates a massive barrier for development. If a minor configuration error (like a missing dependency in package.json or a syntax error in host.json) prevents the function from being "detected," the developer has zero chance of finding that error through the official Azure tools.