aks-cost-analysis
AKS Cost Analysis
Break down AKS spend by cluster, namespace, and utilization bucket. Surfaces the highest-spend clusters and namespaces, and how much spend sits in idle vs active workloads.
Prerequisite: The AKS Cost Analysis add-on must be enabled on the cluster(s). When the add-on isn't enabled,
query_aks_costsreturns no cost data. See Step 1 for the enablement check, and Enable AKS Cost Analysis for setup instructions.
Run the ARG query through the generate → validate → execute workflow. The Step 1 query is ready to run, but pass it to
validate_queryfirst — it confirms the syntax and property paths before you spend a call onexecute_query. If you need to adapt it to a different resource type or field, draft it withgenerate_query(a natural-language prompt), then validate and execute.
Step 1: Verify Clusters Exist and Cost Analysis is Enabled
First, confirm AKS clusters exist on the scope. Call execute_query with this Azure Resource Graph query (replace the <sub-id-…> placeholders with the target subscription IDs):