Sample code on how to enable Application Insights telemetry on an ASP.NET Core web applications.
Fore more information, visit: Adding Application Insights telemetry to your ASP.NET Core website | HildenCo
This repo contains 3 solutions:
- Simple Application Insights demo
- Suppressing Telemetry on Application Insights demo
- Simple Alert based on Application Insights demo
To run the base version, use the code available on master
branch:
git clone https://github.com/hd9/aspnet-ai.git
cd aspnet-ai/src
# add your instrumentation key to src/appSettings.Development.json
dotnet run
To run the version that suppresses telemetry, run the code available on the
telemetry
branch:
git clone https://github.com/hd9/aspnet-ai.git
git checkout telemetry
cd aspnet-ai/src
# add your instrumentation key to src/appSettings.Development.json
dotnet run
To run the version that produces Application Insights alerts, run the code
available on the alerts
branch:
git clone https://github.com/hd9/aspnet-ai.git
git checkout alerts
cd aspnet-ai/src
# add your instrumentation key to src/appSettings.Development.json
dotnet run
To work, this solution requires a valid Instrumentation Key
on your appSettings.json
.
And don't forget to visit blog.hildenco.com.
MIT