Search code examples
azureanalyticsazure-application-insightsazure-static-web-appazure-static-website-hosting

Deeper analytics for Azure Static Web Apps?


Is it possible to access analytics such as browser, dates and times of site hits, IP addresses, etc.?

From the docs here, it looks like Azure App Insights are only available for Static Web Apps that use Azure Functions. I just have a static website, no API's.

Here is the message I'm shown when trying to enable App Insights: enter image description here

Ideally, I want to set a Diagnostic Setting and use Azure Log Analytics to view analytics.

How can I get deeper analytics on a Static Web App without a Function API?

EDIT 1: I'd like to at least capture the number of hits somewhere.

  • Azure Metrics is grabbing them, but doesn't seem to expose logs anywhere, only these visualizations.

enter image description here


Solution

  • Ended up going with:

    • A stand-alone Application Insights instance
      • Azure Static Apps does not allow App Insights to be turned on for the resource unless there is an Azure Function involved(?)
    • Added this App Insights Javascript snippet to each page of the static site.

    Got some great help from @MSNEV!

    This is the solution I was looking for.