Skip to content

Files

Latest commit

 

History

History
23 lines (15 loc) · 709 Bytes

File metadata and controls

23 lines (15 loc) · 709 Bytes

Enable Application Insights for Kubernetes in .NET Core Console Application

The following code shows a sample console application that's configured to send ILogger traces to Application Insights with Kubernetes enricher.

  • Create a console application

    dotnet new console
  • Add packages

    dotnet add package Microsoft.Extensions.DependencyInjection
    dotnet add package Microsoft.Extensions.Logging.ApplicationInsights
    dotnet add package Microsoft.ApplicationInsights.Kubernetes
  • Replace the code in Program.cs.

References