azure-mgmt-applicationinsights-dotnet – DevOps & Infrastructure skill for AI agents
Azure Application Insights SDK for .NET. Application performance monitoring and observability resource management.
Install the azure-mgmt-applicationinsights-dotnet skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-mgmt-applicationinsights-dotnet-676f9.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /azure-mgmt-applicationinsights-dotnet – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-mgmt-applicationinsights-dotnet-676f9.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $azure-mgmt-applicationinsights-dotnet – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-mgmt-applicationinsights-dotnet-676f9.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /azure-mgmt-applicationinsights-dotnet – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-mgmt-applicationinsights-dotnet-676f9.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /azure-mgmt-applicationinsights-dotnet – then describe the task you want done.
SKILL.md content
Azure.ResourceManager.ApplicationInsights (.NET)
Azure Resource Manager SDK for managing Application Insights resources for application performance monitoring.
Installation
dotnet add package Azure.ResourceManager.ApplicationInsights
dotnet add package Azure.IdentityPin a supported tested SDK version and verify each operation against its API reference; package and ARM API versions differ. These independent fragments are not a single compiled program.
Environment Variables
AZURE_SUBSCRIPTION_ID=<your-subscription-id>
AZURE_RESOURCE_GROUP=<your-resource-group>
AZURE_APPINSIGHTS_NAME=<your-appinsights-component>Authentication
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.ApplicationInsights;
ArmClient client = new ArmClient(new DefaultAzureCredential());Resource Hierarchy
Subscription
└── ResourceGroup
└── ApplicationInsightsComponent # App Insights resource
├── ApplicationInsightsComponentApiKey # API keys for programmatic access
├── ComponentLinkedStorageAccount # Linked storage for data export
└── (via component ID)
├── WebTest # Availability tests
├── Workbook # Workbooks for analysis
├── WorkbookTemplate # Workbook templates
└── MyWorkbook # Private workbooksSelect the intended tenant/subscription and verify the credential/roles. Create/update/delete operations and scheduled tests require target-specific authorization, cost review and rollback/retention planning. Avoid logging telemetry content or keys. Workspace-based retention is governed by the linked workspace/table configuration; component fields alone do not establish effective retention or application SDK sampling. Private Link requires the complete scope, DNS and access policy setup.
Core Workflows
1. Create Application Insights Component (Workspace-based)
using Azure.ResourceManager.ApplicationInsights;
using Azure.ResourceManager.ApplicationInsights.Models;
using Azure;
using Azure.Core;
using Azure.ResourceManager.Resources;
string subscriptionId = Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID")
?? throw new InvalidOperationException("Missing subscription");
SubscriptionResource subscription = client.GetSubscriptionResource(
new ResourceIdentifier($"/subscriptions/{subscriptionId}"));
ResourceGroupResource resourceGroup = (await subscription
.GetResourceGroupAsync("my-resource-group")).Value;
ApplicationInsightsComponentCollection components = resourceGroup.GetApplicationInsightsComponents();
// Workspace-based Application Insights (recommended)
ApplicationInsightsComponentData data = new ApplicationInsightsComponentData(
AzureLocation.EastUS,
ApplicationInsightsApplicationType.Web)
{
Kind = "web",
WorkspaceResourceId = new ResourceIdentifier(
"/subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.OperationalInsights/workspaces/<workspace-name>"),
IngestionMode = IngestionMode.LogAnalytics,
PublicNetworkAccessForIngestion = PublicNetworkAccessType.Enabled,
PublicNetworkAccessForQuery = PublicNetworkAccessType.Enabled,
RetentionInDays = 90,
SamplingPercentage = 100,
DisableIPMasking = false,
ImmediatePurgeDataOn30Days = false,
Tags =
{
{ "environment", "production" },
{ "application", "mywebapp" }
}
};
ArmOperation<ApplicationInsightsComponentResource> operation = await components
.CreateOrUpdateAsync(WaitUntil.Completed, "my-appinsights", data);
ApplicationInsightsComponentResource component = operation.Value;
Console.WriteLine($"Component created: {component.Data.Name}");
// Keep ingestion identifiers in approved configuration; do not log them.
// Pass the connection string to approved configuration without logging.2. Get Connection String and Keys
ApplicationInsightsComponentResource component = await resourceGroup
.GetApplicationInsightsComponentAsync("my-appinsights");
// Get connection string for SDK configuration
string connectionString = component.Data.ConnectionString;
string instrumentationKey = component.Data.InstrumentationKey;
string appId = component.Data.AppId;
// Do not print connectionString.
// Do not print instrumentationKey.
Console.WriteLine($"App ID: {appId}");3. Telemetry Query Authentication
Prefer supported Microsoft Entra authentication and least-privilege query roles. Do not create or log legacy telemetry-query API keys; verify the current query API/authentication lifecycle before migrating existing clients. Management-plane credentials are separate from ingestion and query access.
4. Availability Monitoring
Use supported Standard availability tests for new deployments. The former URL Ping XML example was deprecated, and multi-step .webtest tests retired in2024. Inspect current region/location identifiers, pricing, request/response validation, retry policy and TLS settings before enabling a scheduled test. For a multi-request journey, choose an explicitly supported synthetic runner with test-only credentials; this skill does not supply one. Never assume {{TestPassword}} interpolation is provided by the ARM SDK.
6. Create Workbook
WorkbookCollection workbooks = resourceGroup.GetWorkbooks();
WorkbookData workbookData = new WorkbookData(AzureLocation.EastUS)
{
DisplayName = "Application Performance Dashboard",
Category = "workbook",
Kind = WorkbookSharedTypeKind.Shared,
SerializedData = """
{
"version": "Notebook/1.0",
"items": [
{
"type": 1,
"content": {
"json": "# Application Performance\n\nThis workbook shows application performance metrics."
},
"name": "header"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "requests\n| summarize count() by bin(timestamp, 1h)\n| render timechart",
"size": 0,
"title": "Requests per Hour",
"timeContext": {
"durationMs": 86400000
},
"queryType": 0,
"resourceType": "microsoft.insights/components"
},
"name": "requestsChart"
}
],
"isLocked": false
}
""",
SourceId = component.Id,
Tags =
{
{ "environment", "production" }
}
};
// Note: Workbook ID should be a new GUID
string workbookId = Guid.NewGuid().ToString();
ArmOperation<WorkbookResource> operation = await workbooks
.CreateOrUpdateAsync(WaitUntil.Completed, workbookId, workbookData);
WorkbookResource workbook = operation.Value;
Console.WriteLine($"Workbook created: {workbook.Data.DisplayName}");7. Link Storage Account
ApplicationInsightsComponentResource component = await resourceGroup
.GetApplicationInsightsComponentAsync("my-appinsights");
ComponentLinkedStorageAccountCollection linkedStorage = component.GetComponentLinkedStorageAccounts();
ComponentLinkedStorageAccountData storageData = new ComponentLinkedStorageAccountData
{
LinkedStorageAccount = new ResourceIdentifier(
"/subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.Storage/storageAccounts/<storage-account>")
};
ArmOperation<ComponentLinkedStorageAccountResource> operation = await linkedStorage
.CreateOrUpdateAsync(WaitUntil.Completed, StorageType.ServiceProfiler, storageData);8. List and Manage Components
// List all Application Insights components in resource group
await foreach (ApplicationInsightsComponentResource component in
resourceGroup.GetApplicationInsightsComponents())
{
Console.WriteLine($"Component: {component.Data.Name}");
Console.WriteLine($" App ID: {component.Data.AppId}");
Console.WriteLine($" Type: {component.Data.ApplicationType}");
Console.WriteLine($" Ingestion Mode: {component.Data.IngestionMode}");
Console.WriteLine($" Retention: {component.Data.RetentionInDays} days");
}
// List web tests
await foreach (WebTestResource webTest in resourceGroup.GetWebTests())
{
Console.WriteLine($"Web Test: {webTest.Data.WebTestName}");
Console.WriteLine($" Enabled: {webTest.Data.IsEnabled}");
Console.WriteLine($" Frequency: {webTest.Data.Frequency}s");
}
// List workbooks
await foreach (WorkbookResource workbook in resourceGroup.GetWorkbooks())
{
Console.WriteLine($"Workbook: {workbook.Data.DisplayName}");
}9. Update Component
ApplicationInsightsComponentResource component = await resourceGroup
.GetApplicationInsightsComponentAsync("my-appinsights");
// Update using full data (PUT op… (full content is in the download package)
Related skills
- azure-mgmt-arizeaiobservabilityeval-dotnet – Azure Resource Manager SDK for Arize AI Observability and Evaluation (.NET).
- azure-mgmt-botservice-dotnet – Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for…
- azure-mgmt-botservice-py – Azure Bot Service Management SDK for Python. Use for creating, managing, and configuring…
- azure-mgmt-fabric-dotnet – Azure Resource Manager SDK for Fabric in .NET.
- azure-mgmt-fabric-py – Azure Fabric Management SDK for Python. Use for managing Microsoft Fabric capacities and…
- azure-mgmt-mongodbatlas-dotnet – Manage MongoDB Atlas Organizations as Azure ARM resources with unified billing through…
- azure-mgmt-weightsandbiases-dotnet – Azure Weights & Biases SDK for .NET. ML experiment tracking and model management via…
- mtls-configuration – Configure mutual TLS (mTLS) for zero-trust service-to-service communication. Use when…