Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Created February 14, 2026 16:03
Show Gist options
  • Select an option

  • Save wullemsb/e41a9783b0f1fe9fdf5f061de27ecf00 to your computer and use it in GitHub Desktop.

Select an option

Save wullemsb/e41a9783b0f1fe9fdf5f061de27ecf00 to your computer and use it in GitHub Desktop.
name description
application-insights
Add instrumentation to an application to send useful telemetry data to Azure App Insights

AppInsights instrumentation

This skill enables sending telemetry data of an application to Azure App Insights for better observability of the app's health.

When to use this skill

Use this skill when the user wants to enable telemetry for their application.

Prerequisites

The app in the workspace must be one of these kinds

  • An ASP.NET Core app
  • A .NET Core Worker Service app
  • An Angular app

Guidelines

Collect context information

Find out the (programming language, application framework, hosting) tuple of the application the user is trying to add telemetry support in. This determines how the application can be instrumented. Read the source code to make an educated guess. Confirm with the user on anything you don't know.

Add instrumentation

Add instrumentation to the app by creating the AppInsights resource and update the app's code.

Create AppInsights resource

Use one of the following options that fits the environment.

  • Use Azure Portal. See this guide for steps to create an App Insights resource via Azure Portal.
  • Use Azure CLI. See scripts/appinsights.ps1 for what Azure CLI command to execute to create the App Insights resource.

Modify application code

  • If the app is an ASP.NET Core app, see ASPNETCORE guide for how to modify the C# code.
  • If the app is a .NET Core app using a worker service, see NETCORE guide for how to modify the C# code.
  • If the app is an Angular app, see ANGULAR guide for how to modify the TypeScript code.

Validation checklist

  • Connectionstring is loaded from the appsettings ApplicationInsights section.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment