CasCap.Api.Azure.LogAnalytics 1.7.1

Prefix Reserved
dotnet add package CasCap.Api.Azure.LogAnalytics --version 1.7.1
                    
NuGet\Install-Package CasCap.Api.Azure.LogAnalytics -Version 1.7.1
                    
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="CasCap.Api.Azure.LogAnalytics" Version="1.7.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CasCap.Api.Azure.LogAnalytics" Version="1.7.1" />
                    
Directory.Packages.props
<PackageReference Include="CasCap.Api.Azure.LogAnalytics" />
                    
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 CasCap.Api.Azure.LogAnalytics --version 1.7.1
                    
#r "nuget: CasCap.Api.Azure.LogAnalytics, 1.7.1"
                    
#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 CasCap.Api.Azure.LogAnalytics@1.7.1
                    
#: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=CasCap.Api.Azure.LogAnalytics&version=1.7.1
                    
Install as a Cake Addin
#tool nuget:?package=CasCap.Api.Azure.LogAnalytics&version=1.7.1
                    
Install as a Cake Tool

CasCap.Api.Azure.LogAnalytics

Azure Monitor Log Analytics helpers for .NET applications that query Application Insights data. IQueryService exposes two fixed queries, not a general-purpose Kusto query interface.

Installation

Targets net8.0, net9.0 and net10.0.

dotnet add package CasCap.Api.Azure.LogAnalytics

Usage

Register the application's configuration, logger infrastructure and an authorized TokenCredential before registering this package:

using Azure.Core;
using CasCap.Abstractions;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

services.AddSingleton<IConfiguration>(configuration);
services.AddLogging();
services.AddSingleton<TokenCredential>(credential);
services.AddCasCapLogAnalyticsServices();

Consumers can inject IQueryService:

var exceptions = await queryService.GetExceptions(limit: 20);
  • GetExceptions(limit = 50) queries the exceptions table over the last day and maps rows to AppInsightsObject. Its query applies limit before ordering by timestamp; it does not guarantee the newest records across the entire window.
  • Query(QueryTimeRange) runs union * | limit 50 | order by timestamp and logs returned values. Use it only where logs may safely contain workspace data.

Both methods require the table and column names expected by the implementation. Workspaces using different schemas need a different query client. Neither method accepts a cancellation token.

Configuration Examples

LogAnalyticsConfig.WorkspaceId is required and binds from CasCap:LogAnalyticsConfig. Registration binds options but does not add startup validation.

{
  "CasCap": {
    "LogAnalyticsConfig": {
      "WorkspaceId": "00000000-0000-0000-0000-000000000000"
    }
  }
}

Replace the placeholder with your workspace ID through your application's configuration. Grant the credential permission to query that workspace, such as an appropriate Log Analytics read role. This package does not acquire credentials or configure workspace access.

Documentation

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.7.1 95 10/24/2026
1.7.0 93 10/21/2026
1.6.4 112 10/4/2026
1.6.3 108 9/25/2026
1.6.2 104 9/23/2026
1.6.1 111 9/21/2026
1.6.0 108 9/19/2026
1.5.5 110 9/11/2026
1.5.4 112 9/1/2026
1.5.3 123 8/18/2026
1.5.2 149 7/15/2026
1.5.1 148 6/26/2026
1.5.0 134 6/12/2026
1.4.13 137 6/10/2026
1.4.12 141 5/27/2026
1.4.11 138 5/26/2026
1.4.10 137 5/21/2026
1.4.9 126 5/20/2026
1.4.8 146 5/13/2026
1.4.7 153 5/8/2026
Loading failed