Contents

Chapter 1

FinOps Playbook for Azure

Azure Cost Guardian Toolkit by Datanest Digital


About This Playbook

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.


Table of Contents

1. FinOps Foundations

2. Phase 1: Crawl — Visibility & Allocation

3. Phase 2: Walk — Optimization & Governance

4. Phase 3: Run — Automation & Continuous Improvement

5. Key Azure Cost Levers

6. Organizational Model

7. KPIs & Metrics

8. Common Pitfalls


1. FinOps Foundations

What Is FinOps?

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.

Core Principles

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.

Prerequisites for This Toolkit

Before beginning, ensure you have:

  • [ ] Azure subscription(s) with Cost Management Reader role (minimum)
  • [ ] Python 3.9+ environment with Azure SDK installed
  • [ ] Terraform 1.5+ (for infrastructure automation)
  • [ ] Databricks workspace (for notebook-based analysis)
  • [ ] A designated FinOps team or owner

2. Phase 1: Crawl — Visibility & Allocation

Goal: Achieve full visibility into Azure spend and establish cost allocation.

Timeline: 2-4 weeks

Step 1.1: Establish Tagging Standards

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 KeyPurposeExample Values
CostCenterFinancial allocationCC-1001, CC-2050
EnvironmentLifecycle stageprod, staging, dev
DepartmentOrganizational unitEngineering, DataScience
OwnerAccountabilityjane.doe@company.com
ProjectProject trackingproject-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

Step 1.2: Deploy Budget Alerts

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:

  • 50% — Informational (FinOps team only)
  • 80% — Warning (FinOps + engineering leads)
  • 100% — Critical (FinOps + engineering + finance)
  • 110% — Forecasted (early warning)

Step 1.3: Build Cost Visibility

Use the query library to build initial reports.

Key Queries to Run First:

python
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:

  • [ ] Current month spend by service
  • [ ] Spend by resource group
  • [ ] Spend by department (tag)
  • [ ] Untagged spend quantified
  • [ ] Month-over-month trend

Step 1.4: Establish Reporting Cadence

Use the templates to create your first reports:

  • Weekly: Quick spend check — review anomalies and budget status
  • Monthly: Full review using templates/monthly_finops_review.md
  • Quarterly: Strategic review with finance and leadership

Phase 1 Checklist

  • [ ] Tagging policy deployed (Audit mode)
  • [ ] Budget alerts active on all subscriptions
  • [ ] Cost visibility dashboards or reports in place
  • [ ] Monthly review cadence established
  • [ ] Untagged spend identified and owners assigned

3. Phase 2: Walk — Optimization & Governance

Goal: Eliminate waste and implement proactive cost optimization.

Timeline: 4-8 weeks

Step 2.1: Eliminate Idle Resources

Run the idle resource detector to find immediate savings.

bash
python scripts/idle_resource_detector.py \
    --subscription-id <sub-id> \
    --idle-days 7 \
    --output-format text

Common Findings:

  • Unattached managed disks (often left after VM deletion)
  • Stopped VMs with attached premium disks
  • Orphaned public IPs ($3.65/month each)
  • Unattached NICs indicating incomplete cleanup

Process:

1. Run detection weekly

2. Assign cleanup owners per resource group

3. Track savings in the monthly review

Step 2.2: Implement Storage Lifecycle Management

Storage costs grow silently. Apply lifecycle policies to move cold data to cheaper tiers.

bash
python scripts/storage_lifecycle_manager.py \
    --subscription-id <sub-id> \
    --cool-after-days 30 \
    --archive-after-days 90 \
    --dry-run

Typical Savings: 40-60% on storage costs for data older than 30 days.

Step 2.3: Act on Advisor Recommendations

Azure Advisor provides free optimization recommendations. Automate their retrieval.

bash
python scripts/advisor_automation.py \
    --subscription-id <sub-id> \
    --category Cost \
    --impact High \
    --output-format text

Process:

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

Step 2.4: Enforce Tagging (Deny Mode)

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

Step 2.5: Implement Chargeback/Showback

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%

Phase 2 Checklist

  • [ ] Idle resource detection running weekly
  • [ ] Storage lifecycle policies applied
  • [ ] Advisor recommendations reviewed and tracked
  • [ ] Tagging switched to Deny for critical tags
  • [ ] Chargeback/showback reports distributed monthly
  • [ ] Dev/test environments identified and right-sized

4. Phase 3: Run — Automation & Continuous Improvement

Goal: Fully automated cost optimization with proactive anomaly detection.

Timeline: Ongoing

Step 3.1: Deploy Anomaly Detection

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

Step 3.2: Reserved Instance Optimization

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

Step 3.3: Automated Governance

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

Step 3.4: Unit Economics

Move beyond raw cost tracking to business-aligned metrics:

MetricFormula
Cost per customerTotal cloud spend / active customers
Cost per transactionInfrastructure cost / transaction count
Cost per GB processedData platform cost / data volume
Efficiency ratioRevenue / cloud spend

Track these monthly and set targets for improvement.

Step 3.5: Continuous Improvement Cycle

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

Phase 3 Checklist

  • [ ] Daily anomaly detection running automatically
  • [ ] RI/Savings Plan recommendations reviewed monthly
  • [ ] Automated remediation for common waste patterns
  • [ ] Unit economics tracked and improving
  • [ ] FinOps review process mature and executive-sponsored

5. Key Azure Cost Levers

Compute Optimization

LeverTypical SavingsEffort
Right-size VMs20-40%Medium
Reserved Instances (1yr)30-40%Low
Reserved Instances (3yr)50-60%Low
Spot VMs (batch/dev)60-90%Medium
Auto-shutdown dev/test50-70%Low
Azure Hybrid Benefit40-50%Low

Storage Optimization

LeverTypical SavingsEffort
Lifecycle management (tiering)40-60%Low
Delete orphaned disks100% of wasteLow
Reserved capacity20-38%Low
Optimize redundancy (LRS vs GRS)50%Medium

Database Optimization

LeverTypical SavingsEffort
Right-size DTUs/vCores20-40%Medium
Reserved capacity30-55%Low
Elastic pools20-40%Medium
Serverless tier (dev)50-70%Low

Networking Optimization

LeverTypical SavingsEffort
Delete unused public IPs100% of wasteLow
Optimize data transfer paths20-50%High
Use Private EndpointsVariesMedium

6. Organizational Model

FinOps Team Structure

           CTO / VP Engineering
                   |
            FinOps Lead (1 FTE)
           /       |       \
   Platform Eng  Finance  Engineering Leads
   (tooling)    (budget)   (optimization)

RACI Matrix

ActivityFinOps LeadEngineeringFinanceManagement
Set budgetsCIA/RA
Tag resourcesIR-A
Review anomaliesRCII
RI purchasingRCAI
Monthly reviewRCCA
Idle cleanupCR-I

R = Responsible, A = Accountable, C = Consulted, I = Informed


7. KPIs & Metrics

Efficiency KPIs

KPITargetMeasurement
Tag coverage rate>95%get_untagged_resource_cost()
Budget adherence<100% spendBudget alerts
RI/SP utilization>90%get_ri_utilization()
Idle resource waste<2% of total spendidle_resource_detector.py
Cost anomaly resolution time<24 hoursAnomaly detection notebook
Advisor recommendations addressed>80% High impactadvisor_automation.py
KPIDirectionMeasurement
Cost per unit (customer/txn)DecreasingUnit economics tracking
Month-over-month growth rateAt or below revenue growthget_cost_growth_rate()
Commitment coverageIncreasing (to ~70-80%)get_cost_by_pricing_model()
Unallocated spendDecreasingget_untagged_resource_cost()

8. Common Pitfalls

Pitfall 1: Starting with Optimization Before Visibility

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.

Pitfall 2: Over-Committing to Reserved Instances

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.

Pitfall 3: Ignoring Tagging Until It's Too Late

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.

Pitfall 4: Making FinOps a One-Time Project

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).

Pitfall 5: Not Involving Engineering Teams

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.

Pitfall 6: Optimizing for Cost at the Expense of Reliability

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.

Pitfall 7: Treating All Environments the Same

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.


Quick Reference: Toolkit to Playbook Mapping

Playbook StepToolkit Component
Tagging standardspolicies/tagging_enforcement.json
Budget alertspolicies/budget_alerts.json, terraform/cost-management/
Cost visibilityqueries/cost_management_queries.py
Monthly reviewtemplates/monthly_finops_review.md
Idle resource cleanupscripts/idle_resource_detector.py
Storage optimizationscripts/storage_lifecycle_manager.py
Advisor actionsscripts/advisor_automation.py
Anomaly detectionnotebooks/cost_anomaly_detection.py
RI optimizationnotebooks/reserved_instance_calculator.py
Chargeback reportingtemplates/chargeback_report.md

_Azure Cost Guardian Toolkit by Datanest Digital_

Azure Cost Guardian Toolkit v1.0.0 — Free Preview