Note: I have only implemented for Server-Side Blazor
In order to use this please follow these steps
- Download this project and add a reference in your Blazor project within Visual Studio2.
- Add a reference to
<script src="_content/Blazed.ApplicationInsights/blazor-application-insight.js"></script>
in your _Host.cshtml file - Add a reference to
@using Blazed.ApplicationInsights.Components
to your _Imports.razor file - Add
<ApplicationInsights INSTRUMENTATION_KEY="your key here" />
to the bottom of your App.razor file. Ensuring your INSTRUMENTATION_KEY is used. It is possible to inject this from your appsettings.json using DI and IConfiguration Run the project and ensure that the script appears in the html head section of the page