Blazor Web Assembly Application Insights Configuration

Ola B 20 Reputation points
2023-02-24T11:52:08.6533333+00:00

I built Blazor Web Assembly App based upon the Azure Static Web App Template and deployed to an Azure DNS Zone. How do I configure it to use Applications Insights especially Users and Session Data? Any help or pointers to the appropriate documentation would be greatly appreciated.

Regards

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,661 questions
Developer technologies | .NET | Blazor
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,178 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 78,006 Reputation points Volunteer Moderator
    2023-02-24T16:57:02.1633333+00:00

    application insights only works with the code running on the server. say your static website has an api. the Blazor code is running in the browser.

    https://learn.microsoft.com/en-us/azure/static-web-apps/monitor

    you can use javascript interop to add client tracking for application insights:

    https://github.com/microsoft/ApplicationInsights-JS

    and a blazor wrapper over the jsinterop:

    https://github.com/IvanJosipovic/BlazorApplicationInsights

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.