Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dotnet application insights package #102

Open
rajkumar-rangaraj opened this issue Nov 5, 2021 · 0 comments
Open

Add dotnet application insights package #102

rajkumar-rangaraj opened this issue Nov 5, 2021 · 0 comments

Comments

@rajkumar-rangaraj
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant