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
<PackageReference Include="CasCap.Api.Azure.LogAnalytics" Version="1.7.1" />
<PackageVersion Include="CasCap.Api.Azure.LogAnalytics" Version="1.7.1" />
<PackageReference Include="CasCap.Api.Azure.LogAnalytics" />
paket add CasCap.Api.Azure.LogAnalytics --version 1.7.1
#r "nuget: CasCap.Api.Azure.LogAnalytics, 1.7.1"
#:package CasCap.Api.Azure.LogAnalytics@1.7.1
#addin nuget:?package=CasCap.Api.Azure.LogAnalytics&version=1.7.1
#tool nuget:?package=CasCap.Api.Azure.LogAnalytics&version=1.7.1
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 theexceptionstable over the last day and maps rows toAppInsightsObject. Its query applieslimitbefore ordering bytimestamp; it does not guarantee the newest records across the entire window.Query(QueryTimeRange)runsunion * | limit 50 | order by timestampand 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 | Versions 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. |
-
net10.0
- Azure.Identity (>= 1.21.0)
- Azure.Monitor.Query (>= 1.7.1)
- CasCap.Common.Extensions (>= 4.17.0)
- CasCap.Common.Logging (>= 4.17.0)
-
net8.0
- Azure.Identity (>= 1.21.0)
- Azure.Monitor.Query (>= 1.7.1)
- CasCap.Common.Extensions (>= 4.17.0)
- CasCap.Common.Logging (>= 4.17.0)
-
net9.0
- Azure.Identity (>= 1.21.0)
- Azure.Monitor.Query (>= 1.7.1)
- CasCap.Common.Extensions (>= 4.17.0)
- CasCap.Common.Logging (>= 4.17.0)
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 |