Azure Cost Estimator
Real-time inline cost estimates for Azure resources in Bicep, ARM, and Terraform files — powered by the Azure Retail Prices API.
Features
💰 Inline Cost Annotations (CodeLens)
See estimated monthly costs directly above each resource definition:
💰 ~$145.28/mo (Virtual Machine: Standard_D2s_v3)
resource vm 'Microsoft.Compute/virtualMachines@2023-03-01' = {
📊 Status Bar Total
Running total of all resources in the active file:
☁️ Azure Est: $487.50/mo (5 resources)
Expandable cost breakdown in the Explorer panel, sorted by highest cost first.
Supported Resource Types
- Virtual Machines
- App Service Plans
- SQL Databases
- Storage Accounts
- AKS Clusters
- Cosmos DB Accounts
- Key Vault
- Application Gateway
- MySQL / PostgreSQL Flexible Servers
- Load Balancer
- Public IP Addresses
- Azure Firewall
- Redis Cache
- Container Registry
- App Service / Function Apps
- Bicep (
.bicep)
- ARM Templates (
.json with deploymentTemplate schema)
- Terraform (
.tf)
Commands
| Command |
Description |
Azure Cost Estimator: Estimate Current File |
Refresh cost estimates for the active file |
Azure Cost Estimator: Set Region |
Change the Azure region for pricing |
Azure Cost Estimator: Clear Price Cache |
Clear cached prices and re-fetch |
Azure Cost Estimator: Refresh Estimates |
Force refresh all estimates |
Settings
| Setting |
Default |
Description |
azureCostEstimator.defaultRegion |
eastus |
Azure region for pricing |
azureCostEstimator.currency |
USD |
Currency (USD, EUR, GBP, AUD, CAD, JPY, INR, BRL) |
azureCostEstimator.enableCodeLens |
true |
Show inline cost annotations |
azureCostEstimator.enableStatusBar |
true |
Show status bar total |
azureCostEstimator.hoursPerMonth |
730 |
Hours/month for cost calculations |
How It Works
- Parses your Bicep/ARM/Terraform file to extract resource types and SKUs
- Queries the Azure Retail Prices API (public, no authentication required)
- Displays estimated monthly costs inline, in the status bar, and in the sidebar
- Caches prices for 30 minutes to minimize API calls
Requirements
- VS Code 1.85+
- No Azure subscription or authentication required — the Retail Prices API is public
Privacy
This extension only calls the Azure Retail Prices API which is a public, unauthenticated API. No code, file contents, or telemetry is sent anywhere.
| |