agentleFS
kryptophonikkryptophonik/SRE-Skills/skills/sre-azure/SKILL.md

sre-azure

Skill4 starsChanged 23 days agoMITView on GitHub

Use when the system runs on Azure: Resource Health, Azure Monitor, Log Analytics (KQL), AKS/VM/App Service status, Activity Log. Read-only roles via az CLI or Azure MCP; writes need approval.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Wait for explicit human approval before any prod-changing command, MCP write tool, or external post.

    line 12
  2. Distinctive:

    Never use Contributor/Owner for this pack.

    line 34
  3. Very specific:

    Every command below also passes --subscription <subscription-id> so it cannot hit the wrong default.

    line 43
  4. Very specific:

    Every script requires --subscription <subscription-id> and calls through the read-only guard scripts/az-ro.sh (refuses non-read verbs.

    line 96
  5. Distinctive:

    If neither the Azure MCP server nor the az CLI is available, output the commands for the human and stop.

    line 107

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Azure

Safety gates (REQUIRED)

  1. Read-only diagnosis first.
  2. Propose each change with risk (low/med/high) and reversibility.
  3. Wait for explicit human approval before any prod-changing command, MCP write tool, or external post.
  4. Act only as approved, verify, and stop and escalate if anything gets worse.

Full rules: sre-safety-gates. Read-only MCP setup: sre-safety-gates/references/mcp.md.

Process skills: sre-engineer, sre-k8s-triage (AKS), sre-dr-backup-test, sre-capacity-planning, sre-cloud-cost-review, sre-security-incident-triage.

Writes (never run without approval)

Any create, update, delete, set, tag, restart, scale, start/stop/deallocate, swap, restore, failover, role assignment (az role assignment create/delete), az rest --method put|patch|post|delete, az vm run-command, az aks command invoke, and az aks get-credentials --admin (banned; use user credentials).

Inline gate for every WRITE below: show the exact command, subscription, and target, then wait for an explicit "yes".

Minimal roles

RoleScopeFor
Readersubscription / RGstatus, metrics, activity log
Log Analytics ReaderworkspaceKQL queries
Cost Management Readersubscriptionsre-cloud-cost-review
Azure Kubernetes Service Cluster User Roleclusteraz aks get-credentials (Reader is not enough)

Never use Contributor/Owner for this pack.

Always first

az account show --subscription <subscription-id> --query "{name:name, id:id, tenantId:tenantId}" -o table   # confirm with the user
# Do not run `az account set`: it changes the global CLI default for every shell.

Every command below also passes --subscription <subscription-id> so it cannot hit the wrong default.

Health and status (read-only)

az resource list --resource-group <rg> --subscription <subscription-id> -o table
# Resource Health: 2022-10-01 is a valid stable version; 2025-05-01 is the newest
az rest --method get --url "https://management.azure.com/subscriptions/<subscription-id>/resourceGroups/<rg>/providers/Microsoft.ResourceHealth/availabilityStatuses?api-version=2022-10-01"
az aks show -g <rg> -n <cluster> --subscription <subscription-id> --query "{state:provisioningState, power:powerState.code}"
az vm get-instance-view -g <rg> -n <vm> --subscription <subscription-id> --query "instanceView.statuses[].displayStatus"
az webapp show -g <rg> -n <app> --subscription <subscription-id> --query state

AKS credentials (needs AKS Cluster User Role; writes a separate kubeconfig file, never merges into ~/.kube/config; never --admin):

az aks get-credentials -g <rg> -n <cluster> --subscription <subscription-id> --file ./kubeconfig-<cluster>

Azure Monitor and Log Analytics (read-only)

az monitor metrics alert list -g <rg> --subscription <subscription-id> -o table
az monitor metrics list --resource <resource-id> --metric "Percentage CPU" --interval PT5M --aggregation Average --offset 6h
az monitor log-analytics query -w <workspace-guid> --timespan PT1H \
  --analytics-query "AppRequests | where TimeGenerated > ago(1h) | summarize failures=countif(Success == false), total=count() by bin(TimeGenerated, 5m)"
az monitor activity-log list --resource-group <rg> --subscription <subscription-id> --offset 6h -o table

-w takes the workspace customer ID (GUID). AppRequests needs workspace-based Application Insights.

KQL (ContainerLogV2 schema; =~ is case-insensitive because LogLevel casing varies by source):

ContainerLogV2
| where TimeGenerated > ago(30m) and LogLevel =~ "error"
| summarize count() by PodNamespace, ContainerName
| order by count_ desc

Common remediations (WRITE — inline gate each)

ActionCommandRiskReversibleGate
Scale AKS node poolaz aks nodepool scale -g <rg> --cluster-name <c> -n <pool> --node-count <n> --subscription <subscription-id>lowyesCheck enableAutoScaling first (autoscaler overrides). Show command + subscription + target; wait for "yes".
Preview slot swapaz webapp deployment slot swap -g <rg> -n <app> --slot staging --target-slot production --action preview --subscription <subscription-id>medyesApplies production settings to staging; validate staging. Wait for "yes".
Complete slot swapaz webapp deployment slot swap -g <rg> -n <app> --slot staging --target-slot production --action swap --subscription <subscription-id>highyesTouches production directly. Wait for "yes".
Roll back slot swapaz webapp deployment slot swap -g <rg> -n <app> --slot staging --target-slot production --subscription <subscription-id> (swap again)highyesUse if post-swap checks fail. Wait for "yes".
Cancel previewed swapaz webapp deployment slot swap -g <rg> -n <app> --slot staging --target-slot production --action reset --subscription <subscription-id>lowyesWait for "yes".
Restart VMaz vm restart -g <rg> -n <vm> --subscription <subscription-id>mednoWait for "yes".

Bundled scripts and references

Every script requires --subscription <subscription-id> and calls through the read-only guard scripts/az-ro.sh (refuses non-read verbs; never runs az account set).

bash scripts/az-ro.sh --subscription <subscription-id> account show -o table
bash scripts/health-snapshot.sh --subscription <subscription-id> --resource-group <rg> --offset 6h
bash scripts/aks-triage.sh --subscription <subscription-id> --resource-group <rg> --cluster <cluster>
  • Workflows: references/health-triage.md (first step in any Azure incident), references/aks-triage.md
  • references/kql-cheatsheet.md · references/resource-health-activity-log-triage.md · references/least-privilege-roles.md · references/write-command-risk.md

If neither the Azure MCP server nor the az CLI is available, output the commands for the human and stop.

Output

  • Subscription confirmed, findings with commands/KQL used, proposed actions with risk/reversibility and approval status

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.