NetEvolve.HealthChecks.Azure.ApplicationInsights 5.0.0

Prefix Reserved
dotnet add package NetEvolve.HealthChecks.Azure.ApplicationInsights --version 5.0.0
                    
NuGet\Install-Package NetEvolve.HealthChecks.Azure.ApplicationInsights -Version 5.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NetEvolve.HealthChecks.Azure.ApplicationInsights" Version="5.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NetEvolve.HealthChecks.Azure.ApplicationInsights" Version="5.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NetEvolve.HealthChecks.Azure.ApplicationInsights" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NetEvolve.HealthChecks.Azure.ApplicationInsights --version 5.0.0
                    
#r "nuget: NetEvolve.HealthChecks.Azure.ApplicationInsights, 5.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NetEvolve.HealthChecks.Azure.ApplicationInsights@5.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NetEvolve.HealthChecks.Azure.ApplicationInsights&version=5.0.0
                    
Install as a Cake Addin
#tool nuget:?package=NetEvolve.HealthChecks.Azure.ApplicationInsights&version=5.0.0
                    
Install as a Cake Tool

NetEvolve.HealthChecks.Azure.ApplicationInsights

Nuget Nuget

This package provides health checks for Azure Application Insights, allowing you to monitor the availability and connectivity of your telemetry tracking.

💡 This package is available for .NET 6.0 and later.

Installation

To use this package, you need to add the package to your project. You can do this by using the NuGet package manager or by using the dotnet CLI.

dotnet add package NetEvolve.HealthChecks.Azure.ApplicationInsights

Health Check - Azure Application Insights Availability

The health check checks the availability of Azure Application Insights by attempting to track a test telemetry event.

Usage

After adding the package, you need to import the namespace NetEvolve.HealthChecks.Azure.ApplicationInsights and add the health check to the service collection.

using NetEvolve.HealthChecks.Azure.ApplicationInsights;

Depending on the configuration approach, you can use two different approaches.

Parameters

  • name: The name of the health check. The name is used to identify the configuration object. It is required and must be unique within the application.
  • options: The configuration options for the health check. If you don't provide any options, the health check will use the configuration based approach.
  • tags: The tags for the health checks. The tags azure, applicationinsights, and telemetry are always used as default and combined with the user input. You can provide additional tags to group or filter the health checks.

Variant 1: Configuration based

The first approach is to use the configuration-based method. Therefore, you have to add the configuration section HealthChecks:ApplicationInsightsAvailability to your appsettings.json file.

var builder = services.AddHealthChecks();

builder.AddApplicationInsightsAvailability("<name>");

The configuration looks like this:

{
  ..., // other configuration
  "HealthChecks": {
    "ApplicationInsightsAvailability": {
      "<name>": {
        "ConnectionString": "<connection-string>", // required
        "Mode": "<mode>", // required, to specify the client creation mode, either `ConnectionString`, `InstrumentationKey`, or `ServiceProvider`
        "Timeout": "<timeout>" // optional, default is 100 milliseconds
      }
    }
  }
}

Variant 2: Options based

The second approach is to use the options-based method. Therefore, you have to create an instance of ApplicationInsightsAvailabilityOptions and provide the configuration.

var builder = services.AddHealthChecks();

builder.AddApplicationInsightsAvailability("<name>", options =>
{
    options.ConnectionString = "<connection-string>";
    options.Mode = ApplicationInsightsClientCreationMode.ConnectionString;
    ...
    options.Timeout = "<timeout>";
});

Client Creation Modes

The health check supports different modes for creating the Application Insights TelemetryClient:

ConnectionString

Use this mode when you have an Application Insights connection string.

builder.AddApplicationInsightsAvailability("<name>", options =>
{
    options.Mode = ApplicationInsightsClientCreationMode.ConnectionString;
    options.ConnectionString = "InstrumentationKey=12345678-1234-1234-1234-123456789abc;IngestionEndpoint=https://westus-0.in.applicationinsights.azure.com/";
});

Configuration:

{
  "HealthChecks": {
    "ApplicationInsightsAvailability": {
      "<name>": {
        "Mode": "ConnectionString",
        "ConnectionString": "InstrumentationKey=12345678-1234-1234-1234-123456789abc;IngestionEndpoint=https://westus-0.in.applicationinsights.azure.com/"
      }
    }
  }
}
InstrumentationKey

Use this mode when you have an Application Insights instrumentation key.

builder.AddApplicationInsightsAvailability("<name>", options =>
{
    options.Mode = ApplicationInsightsClientCreationMode.InstrumentationKey;
    options.InstrumentationKey = "12345678-1234-1234-1234-123456789abc";
});

Configuration:

{
  "HealthChecks": {
    "ApplicationInsightsAvailability": {
      "<name>": {
        "Mode": "InstrumentationKey",
        "InstrumentationKey": "12345678-1234-1234-1234-123456789abc"
      }
    }
  }
}
ServiceProvider

Use this mode when you have already registered a TelemetryClient in the service provider (e.g., using AddApplicationInsightsTelemetry()).

// First register Application Insights
builder.Services.AddApplicationInsightsTelemetry();

// Then add the health check
builder.AddApplicationInsightsAvailability("<name>", options =>
{
    options.Mode = ApplicationInsightsClientCreationMode.ServiceProvider;
});

Configuration:

{
  "HealthChecks": {
    "ApplicationInsightsAvailability": {
      "<name>": {
        "Mode": "ServiceProvider"
      }
    }
  }
}

💡 You can always provide tags to all health checks, for grouping or filtering.

var builder = services.AddHealthChecks();

builder.AddApplicationInsightsAvailability("<name>", options => ..., "custom", "azure");

License

This project is licensed under the MIT License - see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NetEvolve.HealthChecks.Azure.ApplicationInsights:

Package Downloads
NetEvolve.HealthChecks.Azure

Contains HealthChecks for various Azure services.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.0 321 11/20/2025
4.20.61 108 9/27/2025