Monitoring problem with failing functions from Static Web App

TM164782348 6 Reputation points
2022-07-16T20:12:30.983+00:00

I have a Static Web Application (SWA) linked to a Functions App. When I go to my (SWA) it calls an api function with a standard fetch call, which fails with a 500 Internal Error message. This shows up in the graph of the SWA, but it does not show me why the call failed, and it does not show up in the Application Insights, which is where I believe I should be able to get more information on the failure. Also if I visit a page in my SWA, the page view appears in the charts on the SWA portal, but not in the Application Insights. If I go to the Application Insights link in the SWA area, all boxes are greyed out and the "Enable Application Insights" is set to Yes (but greyed out). I assume this means that it should be monitoring my application.

When I run my Functions App api calls locally, any failures and/or success are shown in the Application Insights.

I am very new to Azure and have simply been going through the basic setup, so I have no special setup - all very basic and untouched. Am I wrong to think that if I go to my SWA then Application Insights should register some sort of "hit"? I feel like there is a missing link between SWA and Application Insights which I have not enabled, but cannot figure out where that is or what it would be.

This is my host.json file if that helps (its the default one):
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[2.*, 3.0.0)"
}
}

Many thanks for any help you can provide.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,016 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
702 questions
{count} vote