How to see JavaScript and CSS files as dependencies in Azure Insights?

Markus Schulte 0 Reputation points
2024-05-29T12:34:53.3266667+00:00

I am using Azure Application Insights for monitoring my Static Web App.

This works fine so far, a lot of events are showing up in Insights, which I can analyze.

When analyzing the dependencies, I can see loaded SVG and JSON files, but not for example images (jpg, png), JavaScript files or CSS files. Is that possible? If so, how?

Screenshot 2024-05-29 142405

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,938 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Monalla-MSFT 12,686 Reputation points
    2024-05-31T18:07:33.08+00:00

    @Markus Schulte - Welcome to Microsoft Q&A and thanks for reaching out to us.

    When you enable Application Insights for your Static Web App, it should automatically start collecting telemetry data for all types of requests, including requests for images (jpg, png), JavaScript files, and CSS files.

    If you're not seeing telemetry data for these types of requests, then there might be an issue in app insights configuration.

    To troubleshoot this issue, you can try the following steps:

    1. Check the sampling policy for your Application Insights instance to make sure that it's not filtering out telemetry data for certain types of requests.
    2. Check your Application Insights configuration to make sure that it's correctly configured to collect telemetry data for your Static Web App.
    3. If you're still not seeing telemetry data for certain types of requests, you can try adding a custom telemetry initializer to your app that sets the ai.operation.name property for each telemetry item based on the file extension of the request. This will allow you to filter and group telemetry data by file type in the Application Insights portal.

    Hope this helps. and please feel free to reach out if you have any further questions.


    Please don't forget to "Accept as Answer" and click "Yes" if the above answer is helpful, so it can be beneficial to the community.

    0 comments No comments