An Azure service that provides an event-driven serverless compute platform.
The production Function App must expose the identical /api/chart-data/run route publicly to the Static Web Apps proxy, with no Function App IP restriction, private endpoint, or service endpoint blocking that proxy.
A successful localhost call proves that the worker and downstream dependency function inside the container, but it does not test the Static Web Apps-to-Function App authentication, routing, or network boundary. Since restarting, redeploying, and relinking did not help, use the checks below rather than repeating them.
1. Validate the linked-backend contract
Check each production-specific requirement:
- Static Web Apps plan and environment
- The Static Web App must use the Standard plan.
- The Function App must be linked to the Production environment under Static Web App → Settings → APIs.
- Existing backend integration is not supported for pull-request environments. ^1^
- Disable managed-function deployment
- Open the production Static Web Apps workflow YAML under
.github/workflows. - Set:
api_location: "" - A Static Web App environment supports only one backend type, so the workflow must not also deploy managed Functions. ^1^
- Open the production Static Web Apps workflow YAML under
- Preserve the
/apiprefix- Inspect the Function App’s deployed
host.json. - Static Web Apps forwards
/api/chart-data/runas that same path. The external Function App therefore must expose/api/chart-data/run, not/chart-data/run. - If
host.jsonremoves or changesextensions.http.routePrefix, restore the defaultapiprefix or otherwise ensure the deployed endpoint is exactly/api/chart-data/run. ^1^
- Inspect the Function App’s deployed
- Confirm the selected production slot
- In Static Web App → APIs, verify that the linked resource and Backend slot are the intended production Function App and slot.
- Compare these values with the working development Static Web App. Differences here are more significant than the Angular deployment because
/apirequests are reverse-proxied to the configured backend. ^2^
2. Check the Function App ingress boundary
Under Function App → Networking, check whether production has any of these:
- Inbound IP access restrictions
- A private endpoint
- Traffic restricted through service endpoints
A linked existing Function App must remain publicly accessible and cannot use those restrictions for this integration. Remove the restriction temporarily for a controlled test; if the request then succeeds, redesign the ingress boundary rather than repeatedly relinking it. ^1^
A private endpoint on the Static Web App itself is a different mechanism: requests arriving there from a public IP normally return 403, not this empty 500. ^3^
3. Check authentication and Function authorization
Linking creates an identity provider named Azure Static Web Apps (Linked) on the Function App. If Function App authentication is enabled:
- It must use App Service Authentication version 2.
- In Function App → Settings → Authentication, verify that the linked provider is present and that no production-only authentication policy rejects the proxied identity.
- Compare the Authentication blade with the working development Function App/link. ^1^
Also inspect the HTTP trigger’s authorization level:
- If it is
functionoradmin, the request must contain an access key. - For a browser call through
/api, either provide the required key as designed or useanonymousauthorization and enforce access through Static Web Apps/App Service authentication instead. Functions require a key unless the trigger’s HTTP access level isanonymous. ^4^
Do not delete the linked identity provider merely as a diagnostic step; that changes the security model and can expose the Function App to anonymous traffic.
4. Determine whether the proxy reached the Function
For bring-your-own Functions, enable Application Insights on the Function App, not only on Static Web Apps. ^5^
Reproduce one failed request, record its UTC timestamp, then run:
requests
| where timestamp > ago(30m)
| where url contains "/api/chart-data/run"
| project timestamp, name, resultCode, success, operation_Id, url
| order by timestamp desc
Then inspect correlated exceptions:
exceptions
| where timestamp > ago(30m)
| project timestamp, operation_Id, type, outerMessage
| order by timestamp desc
Interpret the result:
- No request row: the call did not reach the Functions runtime. Concentrate on the linked resource/slot,
/apiroute, authentication provider, access key, and inbound networking. - Request row with
500: the Function was invoked through the proxy. Filtertracesandexceptionsby itsoperation_Id; compare headers, identity data, configuration, and code paths against the localhost invocation. - Request row with
200, while the client receives500: collect the UTC timestamp, Static Web App hostname, Function App/slot,operation_Id, and response headers, then open an Azure support case for the Static Web Apps integration layer.
Application Insights requires at least Contributor on the Function App and Monitoring Reader on the Application Insights resource; telemetry can take up to five minutes to appear. ^6^
Also run:
- Static Web App → Diagnose and solve problems → Availability and performance
- Static Web App → Diagnose and solve problems → Configuration and Management
- Function App → Diagnose and solve problems → Function App Down or Reporting Errors (Preview)
The latter checks runtime, deployment, configuration, storage, identity, networking, and execution failures. ^7^
References
- Bring your own functions to Azure Static Web Apps
- Overview of API support in Azure Static Web Apps
- Configure private endpoint in Azure Static Web Apps
- Securing Azure Functions
- API support in Azure Static Web Apps with Azure Functions
- Analyze Azure Functions telemetry in Application Insights
- Troubleshoot Azure Functions app down or reporting errors