Skip to content

Instantly share code, notes, and snippets.

@hd9
Last active February 18, 2020 22:02
Show Gist options
  • Save hd9/071f40bcd307ea327ea9c4b7533e879b to your computer and use it in GitHub Desktop.
Save hd9/071f40bcd307ea327ea9c4b7533e879b to your computer and use it in GitHub Desktop.
Initializing Application Insights telemetry on an ASP.NET Core web application
// **********************************************
// Fore more information, visit:
// https://blog.hildenco.com/2020/03/adding-application-insights-telemetry.html
// **********************************************
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
private readonly TelemetryClient _telemetry;
public HomeController(ILogger<HomeController> logger, TelemetryClient telemetry)
{
_telemetry = telemetry;
_logger = logger;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment