Can't proceed Application Insights on Static Web App

Schoolblocks 0 Reputation points
2025-02-24T13:10:36.6166667+00:00

I'm trying to check a logs in a Static Web App resource. I can see errors from Monitoring > Metrics chart but can't see what are the errors. I read that you can create an Application Insight, but when I accessed Settings > Application Insights, the selects keep loading so I can't go further.

Metrics Chart
image Application Insights page (keep loading)

image (1)

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,087 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Laxman Reddy Revuri 2,620 Reputation points Microsoft Vendor
    2025-02-24T15:16:54.4766667+00:00

    Hi @Schoolblocks
    The issue you're facing with Application Insights not loading in your Azure Static Web App is a common one.

    The loading issue in the Application Insights settings page could be due to a temporary Azure portal glitch.
    Missing configuration for Application Insights in your Static Web App.
    Sometimes, caching issues can cause loading problems in the Azure portal. Clear your browser cache or try accessing the portal in an incognito/private window.
    1.If the region you've selected is experiencing issues, try switching to a different region temporarily to see if it resolves the loading problem.
    2.Visit the Azure Status page to verify if there's any ongoing outage or issues related to Application Insights or Static Web Apps in your region.

    3.Check for any resource limitations in your Azure subscription that may prevent the creation of new resources like Application Insights.


  2. Sampath 510 Reputation points Microsoft Vendor
    2025-02-26T08:38:22.87+00:00

    Hello @Schoolblocks,

    Note: Application Insights is only applicable to Static Web Apps that have at least one function. To enable Application Insights, add a function to your app.

    Enabling Application Insights in a Static Web App

    To load Application Insights in a Static Web App, add the following environment variable:

    • Name: APPINSIGHTS_INSTRUMENTATIONKEY
    • Key: <YourInstrumentationKey>

    Example configuration In Azure UI:

    Environment Variable Configuration

    You can set this using the Azure CLI command below:

    
    az staticwebapp appsettings set -n <StaticWebAppName> --setting-names APPINSIGHTS_INSTRUMENTATIONKEY=<YourInstrumentationKey>
    
    

    Azure CLI Command

    It takes 1(or) 2 min to load.

    Application Insights Overview

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it.

    Accept answer
    If you have any further questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.