Skip to content

Add dotnet application insights package #102

@rajkumar-rangaraj

Description

@rajkumar-rangaraj

Add dotnet application insights package to azure-application-insights/buildpack.toml

  [[metadata.dependencies]]
    id = "Microsoft.ApplicationInsights.AutoInstrumentation"
    name = "Azure Application Insights Dotnet Agent"
    sha256 = "placeholder"
    stacks = ["io.buildpacks.stacks.bionic", "io.paketo.stacks.tiny", "*"]
    uri = "https://www.nuget.org/api/v2/package/Microsoft.ApplicationInsights.AutoInstrumentation/2.8.42-beta1"
    version = "2.8.42-beta1"

    [[metadata.dependencies.licenses]]
      type = "MIT"
      uri = "https://github.com/microsoft/ApplicationInsights-dotnet/blob/develop/LICENSE"

Enable auto-instrumentation for .NET Core

Following are the steps to download and enable Application Insights Auto-Instrumentation.

  • Download the latest version Microsoft.ApplicationInsights.DotnetCoreAgent NuGet package
  • Rename Microsoft.ApplicationInsights.DotnetCoreAgent2.8.*.nupkg to Microsoft.ApplicationInsights.DotnetCoreAgent2.8.*.zip
  • Extract the content. e.g. To directory /tmp
  • Set following environment variables in your .NET Core app.
  DOTNET_STARTUP_HOOKS=/tmp/core/StartupHook/Microsoft.ApplicationInsights.StartupHook.dll
  ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=Microsoft.ApplicationInsights.StartupBootstrapper
  APPLICATIONINSIGHTS_CONNECTION_STRING=<Your Connection String>
  • Run the app and verify telemetry flowing to your Application Insights resource

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions