Skip to content

Robertjam954/multimodal_rag_application / .claude/skills/azure-diagnostics

azure-diagnostics

Verified

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, 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.

FileKindSize
SKILL.mdskill md5.5 KB
references/app-service/README.mdmarkdown7.2 KB
references/azure-resource-graph.mdmarkdown2.8 KB
references/container-apps/README.mdmarkdown2.8 KB
references/functions/README.mdmarkdown3.5 KB
references/kql-queries.mdmarkdown1.3 KB
troubleshooting/aks/aks-troubleshooting.mdmarkdown4.9 KB
troubleshooting/aks/general-diagnostics.mdmarkdown1.7 KB
troubleshooting/aks/load-balancer-and-ingress.mdmarkdown3.6 KB
troubleshooting/aks/network-policy.mdmarkdown832 B
troubleshooting/aks/networking.mdmarkdown5.5 KB
troubleshooting/aks/node-issues.mdmarkdown4.7 KB
troubleshooting/aks/pod-failures.mdmarkdown7.7 KB
troubleshooting/aks/references/aks-mcp.mdmarkdown1.5 KB
troubleshooting/aks/references/command-flows.mdmarkdown3.0 KB
troubleshooting/aks/references/inspektor-gadget.mdmarkdown7.0 KB
troubleshooting/aks/references/structured-input-modes.mdmarkdown1.5 KB
troubleshooting/aks/spot-and-zone-issues.mdmarkdown2.5 KB
troubleshooting/aks/upgrade-operations.mdmarkdown2.2 KB
troubleshooting/messaging/README.mdmarkdown1.6 KB
troubleshooting/messaging/auth-best-practices.mdmarkdown6.1 KB
troubleshooting/messaging/azure-eventhubs-dotnet.mdmarkdown3.5 KB
troubleshooting/messaging/azure-eventhubs-java.mdmarkdown3.2 KB
troubleshooting/messaging/azure-eventhubs-js.mdmarkdown2.7 KB
troubleshooting/messaging/azure-eventhubs-py.mdmarkdown4.3 KB
troubleshooting/messaging/azure-servicebus-dotnet.mdmarkdown2.5 KB
troubleshooting/messaging/azure-servicebus-java.mdmarkdown2.2 KB
troubleshooting/messaging/azure-servicebus-js.mdmarkdown2.4 KB
troubleshooting/messaging/azure-servicebus-py.mdmarkdown2.3 KB
troubleshooting/messaging/service-troubleshooting.mdmarkdown4.1 KB

references/functions/README.md

View on GitHub
# 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:

```bash
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

```bash
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

```bash
az monitor app-insights component show \
  --query "[?instrumentationKey=='<key>'] | [0].{name:name, rg:resourceGroup, workspaceId:workspaceResourceId}"
```

#### Step 3: Find the Log Analytics workspace

```bash
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:

```bash
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:

```bash
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:

```bash
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.

finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall