How to optimize Azure spend using cost analysis filters

The Power of Cost Analysis Filters

Azure Cost Management‘s Cost Analysis tool is the primary interface for understanding and optimizing your cloud spending. However, most users only scratch the surface — viewing high-level charts without leveraging the filtering and grouping capabilities that reveal actionable savings opportunities. Effective use of cost analysis filters transforms vague cost concerns into specific, addressable findings: this VM SKU is oversized, that storage account uses premium tiers unnecessarily, and this resource group has no budget coverage.

This guide demonstrates how to use cost analysis filters systematically to identify waste, validate optimization actions, and build ongoing visibility into your Azure spend.

Understanding Cost Analysis View Types

Azure Cost Analysis offers two categories of views, each supporting different filter and grouping configurations:

Smart Views

Smart views are curated, read-only views with built-in KPIs, anomaly detection, and drill-down capabilities. They include:

  • Resources — Individual resource costs with anomaly insights and meter drill-down
  • Resource Groups — Costs aggregated by resource group
  • Services — Costs by Azure service name
  • Subscriptions — Cross-subscription comparison (at management group or billing scope)
  • Reservations — Amortized reservation costs and utilization metrics

Customizable Views

Customizable views let you configure every aspect of the visualization — date range, granularity, chart type, grouping, and filters. You can save, share, pin to dashboards, and subscribe to email delivery for these views.

Essential Filters for Cost Optimization

Filters narrow the data displayed in Cost Analysis to a specific subset of your costs. Combining multiple filters creates focused views that answer specific optimization questions.

Service Name Filter

Filter by service name to isolate costs for a specific Azure service. This is the starting point for service-level optimization.

Cost Analysis → Add filter → Service name → "Virtual Machines"
→ Group by: Resource
→ Sort by: Cost descending
→ Result: All VMs ranked by cost — identify candidates for rightsizing

Pricing Model Filter

The pricing model filter reveals how your costs break down across pricing tiers — crucial for identifying reservation and savings plan opportunities.

Pricing Model Value What It Shows Optimization Action
On Demand Pay-as-you-go consumption Candidates for reservations or savings plans
Reservation Reserved instance charges Check utilization — unused reservations waste money
Spot Spot VM charges Verify workloads are Spot-appropriate
Savings Plan Savings plan charges Check coverage and utilization

To find reservation waste:

Cost Analysis → Add filter → Pricing Model → "Reservation"
→ Switch to Amortized Cost view
→ Set Granularity: Monthly
→ Group by: Charge Type
→ Look for "UnusedReservation" values — this is money wasted on unused RI capacity

Charge Type Filter

Distinguishes between different types of charges on your bill:

  • Usage — Consumption-based charges for running resources
  • Purchase — One-time or recurring purchases (reservations, marketplace)
  • Refund — Credits from reservation exchanges or cancellations
  • Adjustment — Billing corrections and credits

For pure consumption analysis, filter to Charge Type: Usage to exclude purchases and adjustments that might skew your optimization analysis.

Tag Filters

Tags enable business-aligned cost analysis. Filter by tag to answer questions like “How much does the marketing team spend?” or “What is our development environment costing us?”

Cost Analysis → Add filter → Tag → "environment" → "development"
→ Group by: Service name
→ Result: Development environment costs by service
→ Action: Identify services that should be stopped outside business hours

Location Filter

Filter by region to understand geographic cost distribution and identify opportunities to consolidate resources or move workloads to cheaper regions.

Cost Analysis → Add filter → Location → "West Europe"
→ Group by: Resource
→ Compare with same filter on "East US"
→ Result: Identify resources deployed in expensive regions that could be relocated

Publisher Type Filter

Separates first-party Azure charges from marketplace and support costs:

  • Azure — Native Azure service charges
  • Marketplace — Third-party software running on Azure
  • Microsoft 365 — Microsoft 365 charges (if visible in the billing scope)

Optimization Workflows Using Filters

Workflow 1: Find Rightsizing Candidates

  1. Filter: Service name = Virtual Machines
  2. Group by: Resource
  3. Sort by cost descending
  4. Open Azure Advisor in a second tab: Cost recommendations → Right-size or shut down underutilized VMs
  5. Cross-reference the top-cost VMs with Advisor’s rightsizing recommendations
  6. For each recommended VM: Click the recommendation → select the target SKU → click Resize

Workflow 2: Identify Reservation Opportunities

  1. Filter: Pricing Model = On Demand
  2. Group by: Service name
  3. Identify services with large, consistent on-demand spend
  4. Cross-reference with Azure Advisor → Reservations recommendations
  5. Calculate potential savings: typical RI savings are 30-72% depending on term and payment option

Workflow 3: Find Orphaned Resources

  1. Filter: Meter category = Storage + Meter subcategory = Managed Disks
  2. Group by: Resource
  3. Cross-reference with Azure Resource Graph query for unattached disks:
Resources
| where type =~ 'microsoft.compute/disks'
| where managedBy == ''
| project name, resourceGroup, sku.name, diskSizeGB, location
| order by diskSizeGB desc

Unattached disks appearing in both the cost analysis and resource graph query are orphaned and should be deleted or snapshotted and removed.

Workflow 4: Analyze Environment Costs

  1. Filter: Tag = environment : production
  2. Group by: Service name → Monthly granularity
  3. Note the total production cost
  4. Change filter to Tag = environment : development
  5. Compare: Development should typically be 10-30% of production. If it is higher, investigate.

Workflow 5: Validate Spot VM Usage

Cost Analysis → Add filter → Pricing Model → "Spot"
→ Group by: Resource
→ Set Granularity: Daily
→ Look for gaps (eviction events) and compare with On Demand costs for the same resource type

Saving and Sharing Optimized Views

After configuring a useful filter combination, save it for reuse:

  1. Click Save in the toolbar.
  2. Name the view descriptively (e.g., “On-Demand VMs – Rightsizing Candidates”).
  3. The view is saved at the current scope and visible to anyone with Cost Management Reader access.

Pinning to Azure Dashboards

Click Pin to add the cost view as a live tile on an Azure Dashboard. This creates an at-a-glance monitoring view that updates automatically.

Scheduled Email Subscriptions

Click Subscribe to set up recurring email delivery of the cost view. Configure:

  • Frequency: Daily, Weekly, or Monthly
  • Recipients: Up to 20 email addresses
  • Include chart: Toggle on for visual context in the email

A weekly email showing on-demand VM costs grouped by resource is an effective way to keep engineering managers aware of rightsizing opportunities.

Using Azure Advisor Cost Recommendations

Cost analysis filters help you find problems; Azure Advisor provides specific recommendations with estimated savings.

High Impact Recommendations

  • Buy savings plans — Based on your actual usage patterns, Advisor calculates optimal savings plan commitments.
  • Buy reserved instances — Recommends specific RI purchases for consistently running resources.
  • Resize or shut down underutilized VMs — Identifies VMs with low CPU or memory utilization.
  • Use Standard storage for managed disk snapshots — Premium snapshots cost more without providing a performance benefit for backups.

Medium Impact Recommendations

  • Delete unprovisioned ExpressRoute circuits — Circuits that are provisioned on the Azure side but not connected to a provider still incur charges.
  • Reconfigure idle virtual network gateways — VPN and ExpressRoute gateways that have been idle for extended periods.

Acting on VM Resize Recommendations

Azure Advisor → Cost → Select "Right-size or shut down underutilized virtual machines"
→ Review the list of recommended VMs
→ For each VM: Click the VM name
→ Review current vs. recommended SKU
→ Click "Resize" and select the target SKU
→ Schedule during maintenance windows for production VMs

Downloading and Analyzing Cost Data

For deeper analysis beyond what the portal filters can provide, download cost data for offline processing:

  • Download chart — Saves the current visualization as a PNG image.
  • Download data — Exports the filtered table as an Excel or CSV file.
  • Open in Power BI — Opens the current view in Power BI Desktop for advanced analysis.

Downloaded data retains all the filters you applied, so you get exactly the subset you were analyzing. Use Excel pivot tables to create custom groupings and calculations that the portal’s built-in views do not support.

CLI-Based Cost Queries

For automation and scriptable cost analysis, use the Azure CLI or REST API:

# Query this month's costs grouped by service
az costmanagement query \
  --type ActualCost \
  --timeframe MonthToDate \
  --scope "/subscriptions/{subscriptionId}" \
  --dataset-aggregation '{"totalCost":{"name":"Cost","function":"Sum"}}' \
  --dataset-grouping name=ServiceName type=Dimension \
  --output table

# Query costs for a specific tag value
az costmanagement query \
  --type ActualCost \
  --timeframe MonthToDate \
  --scope "/subscriptions/{subscriptionId}" \
  --dataset-aggregation '{"totalCost":{"name":"Cost","function":"Sum"}}' \
  --dataset-grouping name=ResourceId type=Dimension \
  --dataset-filter '{
    "tags": {
      "name": "environment",
      "operator": "In",
      "values": ["production"]
    }
  }' \
  --output table

Building a Weekly Optimization Review Process

Filters are most effective when used as part of a regular review cadence. Here is a suggested weekly optimization review:

Day Review Focus Filter Configuration
Monday Overall spend trend No filter, Daily granularity, Last 30 days
Tuesday VM rightsizing Service: Virtual Machines, Group by: Resource
Wednesday Storage optimization Service: Storage, Group by: Meter subcategory
Thursday Reservation utilization Pricing model: Reservation, Amortized view, Group by: Charge Type
Friday Untagged resources Tag: environment = (blank), Group by: Resource

Common Pitfalls and Best Practices

  • Filter scope matters — Cost analysis at subscription scope cannot see costs in other subscriptions. Use management group or billing scope for cross-subscription analysis.
  • Amortized vs. actual costs — Always use Amortized Cost view when analyzing reservation utilization. Actual Cost view shows the full purchase price in the purchase month, making it impossible to assess ongoing utilization.
  • Tag coverage gaps — Filtering by tag only shows resources with that tag applied. Resources missing the tag are invisible in tag-filtered views. Always check the “untagged” portion to understand your tagging coverage.
  • Forecast accuracy — Cost analysis forecasting requires at least 90 days of historical data for reliable annual projections. Short-history subscriptions will show less reliable forecasts.
  • Data freshness — Cost data refreshes approximately every 4 hours. Do not expect real-time accuracy for same-day analysis.
  • Check costs after deployments — After deploying new resources, check cost analysis daily for the first week to catch any unexpected charges early.

Conclusion

Cost analysis filters are the most accessible and immediate tool for Azure cost optimization. They require no additional setup, no data exports, and no third-party tools — just a browser and the right filter combinations. Start by filtering for on-demand pricing to find reservation candidates, use tag filters to hold teams accountable for their spend, and leverage the pricing model filter to assess reservation utilization. Build a weekly review cadence using saved views and email subscriptions, and pair your cost analysis findings with Azure Advisor recommendations for specific, actionable optimization steps. The organizations that optimize most effectively are not those with the most sophisticated tools — they are the ones that look at their costs regularly and act on what they find.

For more details, refer to the official documentation: What is Microsoft Cost Management.

Leave a Reply