Azure Cost and Usage Actual: Cost by Resource GroupAzure Cost and Usage Actual: Cost by ServiceAzure Cost and Usage Actual: Cost by SubscriptionAzure Cost and Usage Actual: Cost by TagAzure Cost and Usage Actual: Overview
Dashboard: Azure Cost and Usage Actual: Cost by Tag
This dashboard answers the following questions:
- What is the total cost for selected subscriptions and tag key?
- How many unique tag values exist?
- How are costs distributed across different tag values?
- How have costs for different tag values trended over time?
- What are the top 10 most expensive tag values?
- What is the detailed cost breakdown by tag value, subscription, and region?
This dashboard contains 2 cards, 2 inputs and 1 table.
Usage
Install the mod:
mkdir dashboardscd dashboardspowerpipe mod initpowerpipe mod install github.com/turbot/tailpipe-mod-azure-cost-and-usage-insightsStart the Powerpipe server:
powerpipe serverOpen http://localhost:9033 in your browser and select Azure Cost and Usage Actual: Cost by Tag dashboard.
You could also snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe dashboard run azure_cost_and_usage_insights.dashboard.cost_and_usage_actual_cost_by_tag_dashboard --shareQueries
This dashboard uses the the following queries:
with tagged_resources as ( select resource_id, date_trunc('month', date) as month, cost_in_billing_currency, json_extract(tags, '$.' || $2) as tag_value from azure_cost_and_usage_actual r where ('all' in ($1) or subscription_id in $1) and tags is not null and array_contains(json_keys(tags), $2) and json_extract(tags, '$.' || $2) is not null and json_extract(tags, '$.' || $2) <> '""')select strftime(month, '%b %Y') as "Month", replace(tag_value, '"', '') as "Series", round(sum(cost_in_billing_currency), 2) as "Total Cost"from tagged_resourcesgroup by month, tag_valuehaving sum(cost_in_billing_currency) > 0order by month, sum(cost_in_billing_currency) desc;
{ "$1": "subscription_ids", "$2": "tag_key"}