Introducing SaveMoney: Smart FinOps for Azure Resources
Cloud costs can quickly spiral out of control. Forgotten virtual machines, unattached disks, idle App Service Plans—these "ghost resources" accumulate over time, silently draining budgets. To address this challenge, the DX team has built SaveMoney, a tool integrated into the DX CLI that helps teams identify and optimize cloud spending without breaking a sweat.
SaveMoney is read-only, metric-driven, and intelligent. It doesn't delete or modify anything—instead, it generates detailed reports to support informed FinOps decisions.
The Problem: Hidden Cloud Waste
In large cloud environments, it's easy to lose track of resources:
- A developer spins up a VM for testing and forgets to deallocate it
- An App Service Plan remains active after all apps are removed
- Disks persist after VMs are deleted
- Public IPs sit idle with no associated resources
These scenarios are common across organizations, and they add up to significant unnecessary costs. Traditional cloud cost management tools often rely on simple heuristics or require manual tagging—neither of which provides the full picture.
The Solution: Metric-Based Analysis
SaveMoney takes a data-driven approach to cost optimization by analyzing actual Azure Monitor metrics over configurable time periods. Instead of guessing whether a resource is unused, it examines:
- CPU utilization for Virtual Machines and App Service Plans
- Network traffic for VMs, Public IPs, and Static Web Apps
- Memory consumption for App Service Plans and Container Apps
- Transaction counts for Storage Accounts
- Deployment state for Container Apps and App Service Plans
This metric-based detection provides high confidence in the results, reducing false positives and helping teams focus on truly wasteful resources.
Architecture & Multi-Cloud Vision
SaveMoney follows a modular architecture designed for multi-cloud support:
Currently, Azure is the primary supported cloud provider, with comprehensive analysis for common resource types. AWS support is planned for future releases. The architecture separates cloud-specific analyzers from the core logic, making it straightforward to add new providers and expand coverage.
The Azure analyzer is actively evolving. We're continuously refining detection logic, adding support for additional resource types, and improving metric-based thresholds based on real-world feedback.
What SaveMoney Detects
SaveMoney currently analyzes 9 common Azure resource types, focusing on the ones that typically drive the most cloud waste:
- High Cost Risk: Virtual Machines (deallocated or idle), App Service Plans (empty or oversized)
- Medium Cost Risk: Orphaned Disks, unused Public IPs, idle Network Interfaces, disconnected Private Endpoints, low-traffic Storage Accounts and Container Apps
- Low Cost Risk: Static Web Apps with minimal traffic
Each resource is evaluated using a combination of state checks (is it attached? running?) and Azure Monitor metrics (CPU usage, network traffic, transactions) to minimize false positives.
For the complete list of analyzed resources and detection criteria, check out the official documentation.
Getting Started
SaveMoney is available as part of the @pagopa/dx-cli toolchain. Here's how to
use it:
SaveMoney is currently in its initial version. The CLI interface and available commands will evolve over time with additional filters, output options, and workflow integrations based on user feedback and real-world usage.
Prerequisites
- Azure subscription(s) with appropriate permissions
- Azure CLI authentication
- Node.js 22 or higher
Installation
You can invoke the CLI directly via npx without installing globally, and if
you're already using the DX CLI, SaveMoney is included:
npx @pagopa/dx-cli savemoney --help
When installed locally in a monorepo you can also run:
pnpm dx savemoney --help
Configuration Options
SaveMoney supports multiple configuration methods to fit different workflows:
- Config File
- Environment Variables
- CLI Options
- Interactive Prompt
Create a JSON configuration file (e.g., config.json):
{
"tenantId": "your-tenant-id",
"subscriptionIds": ["subscription-id-1", "subscription-id-2"],
"preferredLocation": "italynorth",
"timespanDays": 30
}
Then run:
npx @pagopa/dx-cli savemoney --config config.json
Set environment variables:
export ARM_TENANT_ID="your-tenant-id"
export ARM_SUBSCRIPTION_ID="subscription-id-1,subscription-id-2"
Then run:
npx @pagopa/dx-cli savemoney
Pass options directly via command line:
npx @pagopa/dx-cli savemoney \
--config config.json \
--format table \
--location italynorth \
--days 30 \
--verbose
If no configuration is provided, SaveMoney will prompt you interactively:
npx @pagopa/dx-cli savemoney
# Enter Tenant ID: your-tenant-id
# Enter Subscription IDs (comma-separated): sub-1,sub-2
Output Formats
SaveMoney offers three output formats to suit different use cases:
- JSON Format
- Table Format
- Detailed JSON
Standard JSON output for integration with other tools or CI/CD pipelines:
npx @pagopa/dx-cli savemoney --format json
Example output:
[
{
"costRisk": "high",
"location": "italynorth",
"name": "vm-test-01",
"reason": "Low CPU usage (avg 0.57%). Low network traffic (0.06 MB/day avg).",
"resourceGroup": "rg-test",
"subscriptionId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"suspectedUnused": true,
"type": "Microsoft.Compute/virtualMachines"
}
]
A human-readable summary perfect for terminal viewing:
npx @pagopa/dx-cli savemoney --format table
Example output:
┌────────────────────────┬─────────────────────────────────────┬────────────────┬────────┬──────────────────────────────────────────┐
│ Name │ Type │ Resource Group │ Risk │ Reason │
├────────────────────────┼─────────────────────────────────────┼────────────────┼────────┼──────────────────────────────────────────┤
│ vm-test-01 │ Microsoft.Compute/virtualMachines │ rg-test │ high │ VM is deallocated. │
│ asp-unused-premium │ Microsoft.Web/serverfarms │ rg-prod │ high │ No apps deployed. Premium tier. │
│ disk-unattached │ Microsoft.Compute/disks │ rg-dev │ medium │ Disk is not attached to any VM. │
│ pip-idle-static │ Microsoft.Network/publicIPAddresses │ rg-network │ medium │ Not associated. Static IP not in use. │
└────────────────────────┴─────────────────────────────────────┴────────────────┴────────┴──────────────────────────────────────────┘
Comprehensive output with all resource metadata, ideal for:
- Deep analysis with AI tools or LLMs
- Custom scripts and automation
- Audit trails and compliance reports
npx @pagopa/dx-cli savemoney --format detailed-json
This format includes complete Azure resource properties, tags, locations, SKUs, and more.
The Road Ahead
We're continuously evolving SaveMoney with exciting features on the horizon:
-
Multi-Cloud Expansion – AWS support is on the roadmap, extending the same metric-driven approach to Amazon Web Services and beyond. Our modular architecture makes it straightforward to add analyzers for additional cloud providers.
-
Automated Governance – Automated reports showing unused resources detected in your subscriptions, and CI/CD pipeline integration to flag potential waste before it accumulates.
-
Smarter Analysis – Enhanced detection logic for additional Azure resource types, more sophisticated metric analysis with configurable thresholds, trend analysis to identify usage patterns, and integration with cloud pricing APIs for precise cost impact estimates.
-
Additional Output Formats – Reports based on community feedback for different use cases and workflow integrations.
-
Workflow Integration – Automated PR comments with cost impact analysis, policy-based governance for automatic resource tagging, and custom dashboards showing cost trends and optimization opportunities.
Get Started Today
Ready to uncover hidden waste in your Azure environment? SaveMoney is open-source and available now as part of the DX toolchain.
Start your first analysis in under a minute:
npx @pagopa/dx-cli savemoney --help
Explore the documentation:
- Full CLI documentation – Configuration options, output formats, and usage examples
- GitHub repository – Source code and architecture details
Cloud cost optimization doesn't have to be a monthly fire drill. With the right tools and automation, it becomes part of your daily workflow—invisible, effortless, and continuous.
Happy cost optimization! 💰