Azure Cost Guardian Toolkit by Datanest Digital
This playbook provides a structured, phased approach to implementing FinOps (Financial
Operations) practices for Azure environments. It follows the FinOps Foundation's
Crawl-Walk-Run maturity model and maps specific toolkit components to each stage.
Whether you are starting from zero visibility into cloud costs or looking to mature an
existing FinOps practice, this guide provides concrete, actionable steps.
2. Phase 1: Crawl — Visibility & Allocation
3. Phase 2: Walk — Optimization & Governance
4. Phase 3: Run — Automation & Continuous Improvement
FinOps is a cultural practice that brings financial accountability to the variable-spend
model of cloud. It requires collaboration between engineering, finance, and business teams
to make informed trade-offs between speed, cost, and quality.
1. Teams need to collaborate. Engineering, finance, and business work together on cloud costs.
2. Everyone takes ownership. Engineers own their resource usage; finance owns the budget model.
3. A centralized team drives FinOps. A FinOps team (or function) provides tooling, reporting, and best practices.
4. Reports should be accessible and timely. Cost data must be near real-time, not monthly surprises.
5. Decisions are driven by business value. Not just "spend less" but "spend effectively."
6. Take advantage of the variable cost model. Cloud pricing is dynamic — use it.
Before beginning, ensure you have:
Goal: Achieve full visibility into Azure spend and establish cost allocation.
Timeline: 2-4 weeks
Tags are the foundation of cost allocation. Without them, you cannot attribute costs
to teams, projects, or environments.
Required Tags (enforce via Azure Policy):
| Tag Key | Purpose | Example Values |
|---|---|---|
CostCenter | Financial allocation | CC-1001, CC-2050 |
Environment | Lifecycle stage | prod, staging, dev |
Department | Organizational unit | Engineering, DataScience |
Owner | Accountability | jane.doe@company.com |
Project | Project tracking | project-atlas, migration-v2 |
Implementation:
1. Deploy tagging policies from policies/tagging_enforcement.json
2. Start with Audit effect to measure compliance without blocking deployments
3. Review compliance after 2 weeks, then switch high-priority tags to Deny
Budget alerts prevent spend surprises. Deploy them immediately for every subscription.
Implementation:
1. Review templates in policies/budget_alerts.json
2. Deploy via Terraform: terraform/cost-management/
3. Start with subscription-level budgets, then add resource group and tag-based budgets
Thresholds:
Use the query library to build initial reports.
Key Queries to Run First:
from queries.cost_management_queries import (
get_monthly_cost_by_service,
get_cost_by_resource_group,
get_cost_by_tag,
get_untagged_resource_cost,
get_month_over_month_comparison,
)Deliverables:
Use the templates to create your first reports:
templates/monthly_finops_review.mdGoal: Eliminate waste and implement proactive cost optimization.
Timeline: 4-8 weeks
Run the idle resource detector to find immediate savings.
python scripts/idle_resource_detector.py \
--subscription-id <sub-id> \
--idle-days 7 \
--output-format textCommon Findings:
Process:
1. Run detection weekly
2. Assign cleanup owners per resource group
3. Track savings in the monthly review
Storage costs grow silently. Apply lifecycle policies to move cold data to cheaper tiers.
python scripts/storage_lifecycle_manager.py \
--subscription-id <sub-id> \
--cool-after-days 30 \
--archive-after-days 90 \
--dry-runTypical Savings: 40-60% on storage costs for data older than 30 days.
Azure Advisor provides free optimization recommendations. Automate their retrieval.
python scripts/advisor_automation.py \
--subscription-id <sub-id> \
--category Cost \
--impact High \
--output-format textProcess:
1. Run weekly, filter for High impact
2. Assign each recommendation an owner
3. Track implementation in monthly reviews
4. Suppress recommendations you intentionally decline
After Phase 1's audit period, switch critical tags to Deny enforcement:
1. Switch CostCenter policy to Deny
2. Switch Environment policy to Deny
3. Enable tag inheritance policies (inherit from resource group)
4. Monitor compliance weekly
Use the chargeback template to begin attributing costs to departments.
1. Start with showback (visibility without financial consequences)
2. Use templates/chargeback_report.md for monthly reports
3. Evolve to full chargeback once allocation accuracy exceeds 90%
Goal: Fully automated cost optimization with proactive anomaly detection.
Timeline: Ongoing
Set up the Databricks notebook for daily automated anomaly detection.
1. Deploy notebooks/cost_anomaly_detection.py to Databricks
2. Configure as a daily job (08:00 UTC recommended)
3. Connect webhook alerts to Slack/Teams/PagerDuty
4. Tune thresholds based on your environment's volatility
Use the RI calculator to identify commitment opportunities.
1. Run notebooks/reserved_instance_calculator.py weekly
2. Focus on "high confidence" recommendations first
3. Start with 1-year terms for new workloads
4. Consider 3-year terms only for stable, long-running workloads
5. Review RI utilization monthly — exchange underutilized RIs
Expand beyond alerting to automated remediation:
1. Auto-stop dev VMs after business hours using Azure Automation
2. Auto-scale workloads based on demand patterns
3. Automated cleanup of resources past their expiry date (use tags)
4. Policy-driven guardrails that prevent oversized VM creation in dev
Move beyond raw cost tracking to business-aligned metrics:
| Metric | Formula |
|---|---|
| Cost per customer | Total cloud spend / active customers |
| Cost per transaction | Infrastructure cost / transaction count |
| Cost per GB processed | Data platform cost / data volume |
| Efficiency ratio | Revenue / cloud spend |
Track these monthly and set targets for improvement.
Measure -> Analyze -> Optimize -> Repeat
| | | |
v v v v
Queries Notebooks Scripts Review
1. Measure: Daily cost data collection via API queries
2. Analyze: Weekly anomaly detection and RI analysis
3. Optimize: Monthly idle resource cleanup and Advisor actions
4. Review: Monthly FinOps review with all stakeholders
| Lever | Typical Savings | Effort |
|---|---|---|
| Right-size VMs | 20-40% | Medium |
| Reserved Instances (1yr) | 30-40% | Low |
| Reserved Instances (3yr) | 50-60% | Low |
| Spot VMs (batch/dev) | 60-90% | Medium |
| Auto-shutdown dev/test | 50-70% | Low |
| Azure Hybrid Benefit | 40-50% | Low |
| Lever | Typical Savings | Effort |
|---|---|---|
| Lifecycle management (tiering) | 40-60% | Low |
| Delete orphaned disks | 100% of waste | Low |
| Reserved capacity | 20-38% | Low |
| Optimize redundancy (LRS vs GRS) | 50% | Medium |
| Lever | Typical Savings | Effort |
|---|---|---|
| Right-size DTUs/vCores | 20-40% | Medium |
| Reserved capacity | 30-55% | Low |
| Elastic pools | 20-40% | Medium |
| Serverless tier (dev) | 50-70% | Low |
| Lever | Typical Savings | Effort |
|---|---|---|
| Delete unused public IPs | 100% of waste | Low |
| Optimize data transfer paths | 20-50% | High |
| Use Private Endpoints | Varies | Medium |
CTO / VP Engineering
|
FinOps Lead (1 FTE)
/ | \
Platform Eng Finance Engineering Leads
(tooling) (budget) (optimization)
| Activity | FinOps Lead | Engineering | Finance | Management |
|---|---|---|---|---|
| Set budgets | C | I | A/R | A |
| Tag resources | I | R | - | A |
| Review anomalies | R | C | I | I |
| RI purchasing | R | C | A | I |
| Monthly review | R | C | C | A |
| Idle cleanup | C | R | - | I |
R = Responsible, A = Accountable, C = Consulted, I = Informed
| KPI | Target | Measurement |
|---|---|---|
| Tag coverage rate | >95% | get_untagged_resource_cost() |
| Budget adherence | <100% spend | Budget alerts |
| RI/SP utilization | >90% | get_ri_utilization() |
| Idle resource waste | <2% of total spend | idle_resource_detector.py |
| Cost anomaly resolution time | <24 hours | Anomaly detection notebook |
| Advisor recommendations addressed | >80% High impact | advisor_automation.py |
| KPI | Direction | Measurement |
|---|---|---|
| Cost per unit (customer/txn) | Decreasing | Unit economics tracking |
| Month-over-month growth rate | At or below revenue growth | get_cost_growth_rate() |
| Commitment coverage | Increasing (to ~70-80%) | get_cost_by_pricing_model() |
| Unallocated spend | Decreasing | get_untagged_resource_cost() |
Symptom: Teams optimize individual resources without understanding overall spend patterns.
Solution: Complete Phase 1 (visibility and allocation) before any optimization work.
You cannot improve what you cannot measure.
Symptom: Low RI utilization because workloads changed after purchase.
Solution: Start with 1-year terms. Only commit to 3-year terms for workloads that have
been stable for 6+ months. Monitor utilization monthly with the RI calculator notebook.
Symptom: 40%+ of spend is unallocated because resources were never tagged.
Solution: Deploy tagging policies in Audit mode on day one. Set a 2-week deadline to
reach 80% compliance before switching to Deny.
Symptom: Costs decrease after initial optimization but drift back up within 3-6 months.
Solution: FinOps is a continuous practice, not a project. Establish a monthly review
cadence and automate detection (anomaly detection, idle resource scanning, Advisor checks).
Symptom: FinOps team generates reports that no one acts on.
Solution: Include engineering leads in monthly reviews. Assign optimization actions
to engineers with clear deadlines. Celebrate savings wins publicly.
Symptom: Aggressive right-sizing causes performance issues or outages.
Solution: Always validate sizing changes in staging first. Use Azure Monitor metrics
to confirm actual utilization before right-sizing. Never right-size production without
performance testing.
Symptom: Dev/test environments running 24/7 with production-grade sizing.
Solution: Auto-shutdown dev/test environments outside business hours (saves 50-70%).
Use smaller VM sizes in non-production. Consider Spot VMs for dev workloads.
| Playbook Step | Toolkit Component |
|---|---|
| Tagging standards | policies/tagging_enforcement.json |
| Budget alerts | policies/budget_alerts.json, terraform/cost-management/ |
| Cost visibility | queries/cost_management_queries.py |
| Monthly review | templates/monthly_finops_review.md |
| Idle resource cleanup | scripts/idle_resource_detector.py |
| Storage optimization | scripts/storage_lifecycle_manager.py |
| Advisor actions | scripts/advisor_automation.py |
| Anomaly detection | notebooks/cost_anomaly_detection.py |
| RI optimization | notebooks/reserved_instance_calculator.py |
| Chargeback reporting | templates/chargeback_report.md |
_Azure Cost Guardian Toolkit by Datanest Digital_