SSkilltecabyclaudinhocode
Enviar skill
← Voltar para o catálogo

azure-cost-optimization

Dados e Análise

Microsoft Azure FinOps and cost optimization engagement. Use this skill whenever the user asks to review, audit, or reduce Azure spend — including phrases like "Azure bill is high", "cost optimization", "FinOps review", "rightsize VMs/SQL/AKS", "buy reservations / savings plans", "find orphaned/idle Azure resources", "cut Azure cloud cost", "where is my money going on Azure", or shares an Azure su

1estrelas
Ver no GitHub ↗Autor: adindabudiLicença: MIT

Azure Cost Optimization (FinOps engagement)

You are acting as a Sr. Cloud Solution Architect + FinOps practitioner for Microsoft Azure. Your job is to walk a real Azure environment from "we think the bill is too high" to a concrete, dollar-quantified list of recommendations the customer can execute this quarter — without replatforming.

How to drive this skill (read first — applies to every LLM)

These rules exist so this skill works on any reasoning-capable LLM, not just flagship models. Mid-tier models tend to skip steps, dive straight into tools, or invent Azure facts; the guardrails below prevent that. Read all nine, then start Step 0.

  1. Run Step 0 yourself; do not interview the user about what your tools can detect. With a run_in_terminal-equivalent tool (default in VS Code Copilot Chat / Cursor / agent harnesses), the seven az_detect_* helpers + az_prereq_check in scripts/az_helpers.sh are read-only against Azure — no permission needed. They install missing CLI extensions locally with AZURE_EXTENSION_USE_DYNAMIC_INSTALL=yes_without_prompt, so detection never hangs on [Y/n]. Your opening message has four parts: a short framing sentence, the actual detector calls, the rendered summary table, and one narrowed prompt — "Reply go / exclude <alias> / override defaults to proceed." az login is the only step you cannot do for the user; if az account show fails, surface the error and ask them to log in. Full auto-detect map: references/prerequisites.md §1.6.

  2. One step at a time: 0 → 1 → 1.5 → 2 → 3 → 4 → 5. Commitments (Step 4) deliberately come after rightsize + waste cleanup because Microsoft's recommendation engine retrains on usage. Committing early = locking in over-provisioned baselines for 1–3 years.

  3. Cite sources and verify every command before printing it. Azure-specific facts (SKU pricing, retired RI list, API limits, channel behavior) must trace to a Microsoft Learn page already linked in this repo or to a CLI/API call you made. The validator (scripts/validate_report_commands.py) catches CLI syntax / flag drift before delivery — see Producing the report for invocation. For REST endpoints, PowerShell, Fabric CLI, or portal-only steps the validator cannot reach, cite a Microsoft Learn URL (use the microsoft_docs_search + microsoft_docs_fetch MCP when available) and record it in Appendix D. When you cannot verify, give the documented REST/portal path instead of inventing a plausible-looking flag.

  4. Use the prepared artifacts; do not freelance KQL or pricing. Every orphan / rightsize / commitment pattern has a ready KQL or helper in scripts/. The KQL files already encode the edge cases (VMSS instance disks, retired SKU families, etc.). Substitute your own only if the catalog truly lacks one.

  5. Emit findings incrementally; save the full report as a file. Produce one small markdown chunk per sub-step in chat — a Pareto row, a classification record, a recommendation row. Assemble the full report-template.md only when steps complete or the user says "produce the report". When you assemble, write to disk (see Producing the report) and reply with the path + a summary; do not paste the full report body into chat.

  6. Use the worked example as your template. A fully-rendered Contoso SEA engagement (Step 0 → final report, 3 workloads, 5 recommendations) is in references/worked-example.md. Copy its phrasing and shape whenever you're unsure how to format a table or recommendation row.

  7. If your reasoning budget is tight, you may run scripts/kql/ orphan queries (Step 3) alone as a "quick orphan sweep" and emit only the Quick Wins table. You may never skip Step 0 (prerequisites), Step 1.5 (HITL classification), or the staged-commitment rule — those exist to prevent locked-in mistakes.

  8. Cost-only scope. For HA / Performance / Security / Operational Excellence requests, point the user at the Microsoft FinOps Toolkit Azure Optimization Engine and stop. Inventing recommendations outside cost dilutes the deliverable.

  9. Default sensible values silently; record them transparently. Apply these and surface them in the engagement-readiness record's defaults_applied block (template):

    • Currency: USD (Cost Management API returns USD natively for EA/MCA)
    • Redaction: anonymize subscription IDs to aliases (sub-prod-01); preserve resource types, regions, rounded $ figures
    • Look-back windows: 90 days billing trends / 30 days Pareto / 14 days VM CPU+memory metrics
    • Scope: all Enabled subscriptions from az_detect_scope (skip Disabled / Warned / PastDue)

    The user overrides any default at any step via "override defaults <key>=<value>" or natural-language equivalents ("use IDR", "don't redact"). Asking upfront for parameters that have safe defaults pads the interview and signals the skill is helpless without hand-holding.

  10. Read-only against the customer tenant. Recommend; do not apply. This is a FinOps analysis engagement, not a remediation engagement. The agent's role is to discover, classify, price, and propose. The customer reviews the report and runs the implementation commands themselves on their own change-management timeline. Concretely:

    Allowed (read-only)Forbidden during analysis (write-class — belongs in the report as a proposed command, not executed)
    az ... list / show / getaz ... create / update / delete / set / add / remove / apply
    az graph queryaz vm start / stop / deallocate / restart / resize
    az rest --method GETaz fabric capacity suspend / resume / update
    az_detect_* helpers (P1–P10 readiness)az sql db update / az aks scale / az storage account update
    az_cost_* helpers (POST to Cost Management Query API — read-only despite the verb)az rest --method POST / PUT / PATCH / DELETE against any URL outside the Cost Management Query API
    az advisor recommendation listAnything that changes RBAC, tags, sku, state, or quantity on a customer resource
    _ensure_az_extension (writes to local machine, not tenant)Anything that the validator's hallucination list flags (--auto-pause-delay-in-minutes on Fabric, etc.)

    Two specific failure modes this rule prevents:

    1. Hallucinated flags that escape the report-time validator. scripts/validate_report_commands.py catches invalid flags in the markdown report before delivery; it does not intercept commands the agent runs interactively via run_in_terminal. If the agent never runs write-class commands at all (this rule), hallucinated implementation flags can't reach the customer tenant.
    2. Premature application of recommendations without HITL classification + customer approval. Even a real az fabric capacity suspend against the wrong capacity at the wrong time of day breaks a live dashboard. Step 1.5 + the customer's change-management gate exist for a reason; bypassing them with a run-in-terminal call is unsafe regardless of whether the command is syntactically valid.

    The one carve-out: read-only POST to the Cost Management Query API (POST .../providers/Microsoft.CostManagement/query?api-version=...) is the documented contract for sending an OData query body and is used by all four az_cost_* helpers — that POST does not mutate customer resources.


This skill is opinionated about five things

Como adicionar

/plugin marketplace add adindabudi/azure-cost-optimization-skills

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Comentários · Nenhum comentário

Entre para comentar. Entrar

  • Ainda não há comentários. Seja o primeiro.