All skills
microsoft avatar

/azure-diagnostics

@ae5e585
by microsoftmicrosoft/skills3.1k stars
351

Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, troubleshoot functions, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, service bus dead letter.

Use this Skill: https://skilld.dev/gh/microsoft/skills/azure-diagnostics

This session only. Nothing lands on disk.

referencesfunctionsREADME.md

≈898 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Function Apps Troubleshooting

Find Linked App Insights / Log Analytics

Preferred: Use Azure Resource Graph

A single ARG query returns the App Insights name, instrumentation key, connection string, and Log Analytics workspace for a given function app:

az graph query -q "
resources | where type =~ 'microsoft.web/sites' and name == '<func-app-name>'
| project funcName=name, rg=resourceGroup
| join kind=inner (resources | where type =~ 'microsoft.insights/components' | project appiName=name, rg=resourceGroup, instrumentationKey=properties.InstrumentationKey, connectionString=properties.ConnectionString, workspaceId=properties.WorkspaceResourceId) on rg
| project funcName, appiName, instrumentationKey, connectionString, workspaceId
" -o json

💡 Tip: This join matches by resource group. If App Insights is in a different resource group, use the CLI fallback below.

Fallback: CLI Commands

Step 1: Get the App Insights connection string from app settings
az functionapp config appsettings list \
  --name <func-app-name> -g <rg-name> \
  --query "[?name=='APPLICATIONINSIGHTS_CONNECTION_STRING' || name=='APPINSIGHTS_INSTRUMENTATIONKEY']"
Step 2: Find the App Insights resource by instrumentation key
az monitor app-insights component show \
  --query "[?instrumentationKey=='<key>'] | [0].{name:name, rg:resourceGroup, workspaceId:workspaceResourceId}"
Step 3: Find the Log Analytics workspace
az monitor app-insights component show --app <appinsights-name> -g <rg-name> \
  --query "workspaceResourceId" -o tsv

Confirm logs are flowing

Query App Insights traces table to verify the function app is sending telemetry:

az monitor app-insights query --apps <appinsights-name> -g <rg-name> \
  --analytics-query "traces | where operation_Name != '' | take 1 | project timestamp, operation_Name, message"

For FunctionAppLogs (available in Log Analytics only, not App Insights), query the workspace directly:

az monitor log-analytics query -w <workspace-guid> \
  --analytics-query "FunctionAppLogs | where _ResourceId contains '<func-app-name>' | take 5 | project TimeGenerated, FunctionName, Message, Level"

⚠️ Classic App Insights: Some function apps use classic App Insights without a linked Log Analytics workspace (workspaceId is null). In this case, FunctionAppLogs is not available — use the traces, requests, and exceptions tables via az monitor app-insights query instead. As a last resort, az webapp log tail --name <func-app-name> -g <rg-name> can stream live logs directly.

If results are returned, logs are flowing. If empty, verify the APPLICATIONINSIGHTS_CONNECTION_STRING app setting matches this App Insights instance.

⚠️ Always prefer querying App Insights or Log Analytics for function app logs. az webapp log tail can stream live logs directly but App Insights provides richer data, historical queries, and correlation across requests.

💡 Tip: App Insights logs can be delayed by a few minutes. If you don't see recent data, wait 3-5 minutes and query again.


Check Recent Deployments

Correlate issues with recent deployments by listing deployment history:

az rest --method get \
  --uri "/subscriptions/<subscription-id>/resourceGroups/<rg-name>/providers/Microsoft.Web/sites/<func-app-name>/deployments?api-version=2023-12-01"

Compare deployment timestamps against when errors started appearing in App Insights to identify if a deployment caused the issue.

Source: SKILL.md on GitHub

1 warning15d4 checks · Risk SAFE
  • Gen Agent Trust Hub15d

    This skill is designed for Azure diagnostics and troubleshooting, providing a comprehensive set of guides and scripts that utilize standard tools like the Azure CLI and kubectl. It includes some security considerations, such as the ingestion of logs which provides a surface for indirect prompt injection, and the use of privileged debug pods for advanced diagnostics. These are used within the skill's intended functionality and are accompanied by appropriate guidance for user approval.

  • Socket15d

    No alerts

  • Snyk15d

    Risk: LOW · No issues

  • Runlayer7mo

    4/4 files flagged

Signed by skilld at ae5e585. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
metadata
{
  "author": "Microsoft",
  "version": "1.2.6"
}

README badge

README badge for microsoft/skills/azure-diagnostics