Azure Dev/Test Cost Chef – Comprehensive Resource Auditor

Multi-course audit of Azure dev/test environments with 7 different optimization checks — no enterprise complexity, just results.

Introduction

The Azure Dev/Test Cost Chef is your comprehensive kitchen inspector for Azure dev/test environments 🍳🔍 This PowerShell recipe scans your Azure subscription for resources tagged as dev/test and serves up a multi-course report highlighting 7 different categories of cost optimizations, security issues, and governance gaps.

Forget the enterprise stew of complex dashboards and premium monitoring tools. This script uses Azure's native APIs directly — simple, powerful, and lean enough for any small team, startup, or savvy FinOps operation. Perfect for chefs who want comprehensive insights without cloud complexity. Just run, audit, and optimize. 🚀💰

Cost Optimization Focus

Identifies premium SKUs, oversized VMs, and orphaned resources that are burning budget unnecessarily.

Security & Governance

Flags permissive security groups, missing automation tags, and expired resource groups.

Why Comprehensive Auditing

Dev/test environments are notorious cost and security black holes. This comprehensive auditing approach provides:

40-60% Cost Reduction

Most organizations can cut dev/test costs in half by implementing the recommendations from this comprehensive audit.

Security Posture

Identify overly permissive network security groups and missing governance controls before they become problems.

Operational Hygiene

Establish proper tagging, automation, and lifecycle management practices across all dev/test resources.

Beyond Basic Cost Monitoring

Unlike simple cost monitoring tools, this script provides actionable insights across multiple dimensions: cost optimization, security hardening, and governance compliance. It's designed for teams who want to mature their dev/test operations holistically.

Audit Categories Overview

The Azure Dev/Test Cost Chef performs 7 different audit categories, organized into two main areas:

Cost Optimization Audits

1. Premium SKU Detection

Identifies PaaS services running on premium tiers unnecessarily:

  • App Service Premium plans (P1V2, P2V2, P3V2, P1V3, P2V3, P3V3)
  • SQL Database Premium tiers (P1, P2, P4, P6, P11, P15)
  • Premium Storage accounts and Redis Cache
  • Premium Service Bus and Event Hub namespaces

2. Oversized VMs

Detects VMs with SKUs too large for dev/test workloads:

  • D8s_v3+ series (8+ cores)
  • F8s_v2+ series (8+ cores)
  • E8s_v3+ series (8+ cores)
  • Legacy DS13+, GS3+ series

3. Orphaned Disks

Finds unattached managed disks accumulating storage costs with size and SKU details.

4. Unused Public IPs

Identifies public IP addresses not attached to any resource ($5-15/month each).

Governance & Security Audits

5. Missing Automation Tags

VMs without AutoShutdown, Schedule, or StopStart tags for cost control.

6. Permissive NSGs

Network Security Groups allowing broad inbound access (0.0.0.0/0) on critical ports.

7. Expiration Management

Resource groups missing ExpirationDate, TTL, or DeleteAfter tags for lifecycle management.

Prerequisites & Setup

Before running the Azure Dev/Test Cost Chef, ensure you have the required PowerShell modules and permissions:

Required PowerShell Modules

Install the following Azure PowerShell modules:

PowerShell
# Install required Azure PowerShell modules
Install-Module -Name Az.Accounts -Force
Install-Module -Name Az.Resources -Force
Install-Module -Name Az.Compute -Force
Install-Module -Name Az.Network -Force

# Connect to Azure
Connect-AzAccount
PermissionScopePurpose
ReaderSubscriptionBasic resource enumeration and tag reading
Network Contributor (read-only)SubscriptionNSG and Public IP analysis
Virtual Machine Contributor (read-only)SubscriptionVM status and configuration checking
Storage Account Contributor (read-only)SubscriptionDisk and storage account analysis
Minimum Permissions

The script only requires read permissions and will not modify any resources. The "Contributor" roles listed above are only needed for their read capabilities on specific resource types.

Script Parameters

The DevTest-CostChef.ps1 script accepts the following parameters for customization:

ParameterTypeRequiredDefaultDescription
SubscriptionIdStringNoCurrent contextTarget Azure subscription ID
OutputPathStringNoCurrent directoryDirectory for CSV and HTML reports
DevTestTagsString[]Nodev,test,development,testing,staging,qaTag values identifying dev/test resources
SuppressWarningsBoolNo$trueSuppress Azure PowerShell breaking change warnings
Tag Strategy Customization

The DevTestTags parameter allows you to customize which tag values identify dev/test resources. The script checks all tag keys for these values, making it flexible for different organizational tagging strategies.

Usage Examples

Basic Usage

Quick comprehensive audit with default settings:

PowerShell
# Run complete audit with defaults
.DevTest-CostChef.ps1

Organize reports in a dedicated folder:

PowerShell
# Save reports in organized directory
.DevTest-CostChef.ps1 -OutputPath "./audit-reports"

Advanced Usage

Target specific subscription with custom tag strategy:

PowerShell
# Audit specific subscription with custom tags
.DevTest-CostChef.ps1 -SubscriptionId "12345678-1234-1234-1234-123456789012" -DevTestTags @('dev','test','sandbox','experimental','poc') -OutputPath "./comprehensive-audit" -SuppressWarnings $true

Batch processing multiple subscriptions:

PowerShell
# Process multiple subscriptions
$subscriptions = @(
    "12345678-1234-1234-1234-123456789012",
    "87654321-4321-4321-4321-210987654321"
)

foreach ($sub in $subscriptions) {
    Write-Host "Auditing subscription: $sub"
    .DevTest-CostChef.ps1 -SubscriptionId $sub -OutputPath "./audit-$sub"
}
Automation Integration

The script is designed for automation workflows. Set SuppressWarnings to $truefor clean output in CI/CD pipelines or scheduled tasks.

Report Outputs

CSV Exports (7 Files)

The script generates detailed CSV files for each audit category:

File NameContentKey Columns
PaaS_Premium_Resources.csvPaaS services on premium SKUsResourceName, ResourceType, CurrentSKU, Location
VMs_Missing_Automation.csvVMs without stop/start tagsVMName, PowerState, VMSize, HasStopStartTag
Oversized_VMs.csvVMs too large for dev/testVMName, CurrentSize, PowerState, Location
Orphaned_Disks.csvUnattached managed disksDiskName, SizeGB, SkuName, CreatedDate
Unused_PublicIPs.csvUnattached public IP addressesPublicIPName, IPAddress, AllocationMethod, SkuName
Permissive_NSGs.csvOverly broad security groupsNSGName, PermissiveRulesCount, RuleNames
Expired_ResourceGroups.csvMissing/expired expiration tagsResourceGroupName, HasExpirationTag, IsExpired, ExpirationDate

HTML Reports

Professional CloudCostChefs-branded HTML report includes:

Executive Dashboard

  • High-level metrics across all 7 categories
  • Total resources scanned and issues found
  • Estimated cost impact by category
  • Security posture summary

Detailed Findings

  • Category-specific tables with full details
  • Actionable recommendations for each finding
  • Resource links for quick Azure portal access
  • Mobile-responsive professional design

Optimization Impact

Expected cost savings and improvements by implementing the audit recommendations:

CategoryTypical SavingsImplementation EffortTime to Value
Premium SKU Downgrades50-70% cost reductionLow (configuration change)Immediate
Oversized VM Rightsizing40-60% compute savingsMedium (testing required)1-2 weeks
VM Auto-Shutdown60-80% savings on idle timeLow (tagging)Immediate
Orphaned Disk Cleanup100% storage cost eliminationLow (verification + deletion)Immediate
Public IP Cleanup$5-15/month per IPLow (verification + deletion)Immediate
NSG HardeningSecurity risk reductionMedium (security review)1-2 weeks
Lifecycle Management15-25% overall reductionMedium (policy implementation)2-4 weeks
Quick Wins Strategy

Start with orphaned resources and unused public IPs for immediate 100% cost elimination, then move to premium SKU downgrades and VM auto-shutdown for the biggest impact. Save rightsizing and governance improvements for later phases.

Implementation Roadmap

Recommended 4-week implementation plan for maximum impact:

Week 1: Setup & Quick Wins

  • Install PowerShell modules and verify permissions
  • Run initial comprehensive audit
  • Clean up orphaned disks and unused public IPs
  • Implement VM auto-shutdown tags

Week 2: Cost Optimization

  • Downgrade obvious premium SKU candidates
  • Begin VM rightsizing for oversized instances
  • Test performance impact of downgrades
  • Document cost savings achieved

Week 3: Security & Governance

  • Review and harden permissive NSGs
  • Add expiration tags to resource groups
  • Establish tagging standards and policies
  • Create governance documentation

Week 4: Automation & Monitoring

  • Schedule regular audit runs
  • Set up automated reporting
  • Implement policy enforcement
  • Measure and celebrate success

Troubleshooting

Common issues and solutions when running the Azure Dev/Test Cost Chef:

IssueCauseSolution
Authentication errorsNot logged into AzureRun Connect-AzAccount before script
Permission denied errorsInsufficient Azure permissionsVerify Reader role on subscription
Module not found errorsMissing PowerShell modulesInstall Az.Accounts, Az.Resources, Az.Compute, Az.Network
Empty resultsNo dev/test tagged resourcesVerify DevTestTags parameter matches your tagging
Slow executionLarge subscription with many resourcesUse resource group filtering or run during off-hours
CSV encoding issuesRegional settingsOpen CSV files with UTF-8 encoding
HTML report not displayingBrowser security settingsSave HTML file locally and open in browser
Large Subscription Performance

For subscriptions with thousands of resources, the script may take 10-15 minutes to complete. Consider running during off-hours or implementing resource group filtering for faster execution.

Download & Installation

🍳 Get Your Azure Dev/Test Cost Chef

Ready to start comprehensive auditing of your Azure dev/test environments? Download the complete PowerShell script and start identifying optimization opportunities across 7 different categories.

Direct Download

Get the latest version of the DevTest-CostChef.ps1 script

Download PowerShell Script

Version 2.0 | Updated: 6/28/2025 | Size: ~15KB

One-Line Installation

Copy and paste this command to download and run the script directly:

PowerShell
# Download and run Azure Dev/Test Cost Chef
Invoke-WebRequest -Uri "https://cloudcostchefs.com/downloads/azure-devtest-auditor.ps1" -OutFile "DevTest-CostChef.ps1"
.DevTest-CostChef.ps1 -OutputPath "./audit-reports"
7
Audit Categories
15KB
Script Size
5 min
Setup Time
60%
Avg Savings

Alternative Access Methods

  • GitHub Repository: View source code and contribute
  • PowerShell Gallery: Install-Script -Name DevTest-CostChef
  • Azure Cloud Shell: Pre-installed in CloudCostChefs Cloud Shell environment
  • Docker Container: Run in isolated container with all dependencies

Ready to Chef Up Your Dev/Test Optimization?

The Azure Dev/Test Cost Chef is your complete solution for comprehensive dev/test environment optimization. With 7 different audit categories, you'll identify cost savings, security improvements, and governance gaps that most organizations miss with basic monitoring tools.

Most teams see 40-60% cost reductions and significantly improved security posture within the first month of implementation.