A TypeScript-based web application for calculating Azure VM and storage costs from spreadsheet data.
- Upload CSV and Excel files with drag-and-drop interface
- Smart column mapping with automatic detection
- Real-time Azure pricing via Azure Retail Prices API
- Multi-region support (40+ Azure regions)
- Windows and Linux VM pricing
- Storage cost calculation
- Node.js 18.x or higher
- npm or yarn
- Clone the repository:
git clone <repository-url>
cd azure-calculator
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Open http://localhost:3000 in your browser.
Copy .env.example
to .env.local
and adjust settings as needed. All environment variables are optional and have sensible defaults.
This application is optimized for deployment on Vercel:
- Install Vercel CLI:
npm i -g vercel
- Login and link your project:
vercel login
vercel link
- Configure environment variables (optional):
# Use the helper script to set up environment variables
./scripts/setup-vercel-env.sh
# Or set them manually via Vercel dashboard
# Go to https://vercel.com/dashboard → Your Project → Settings → Environment Variables
- Deploy:
vercel --prod
The application will work with default settings without any environment variables configured.
- Upload: Drop your CSV or Excel file on the home page
- Map Columns: Match your spreadsheet columns to required fields
- Calculate: Get Azure cost estimates for your infrastructure
Your spreadsheet must contain these columns:
- RAM Allocated (GB): Memory allocation in gigabytes
- Storage Allocated (GB): Storage capacity in gigabytes
- Logical CPU Count: Number of virtual CPUs
- Operating System Version: OS type and version
- Region: Azure region identifier
- Hours to run: Number of hours per month the server will run
See data2/sample_servers.csv
for a complete example.
azure-calculator/
├── src/
│ ├── app/
│ │ ├── api/azure-prices/ # API proxy route
│ │ ├── calculator/ # Main calculator interface
│ │ └── page.tsx # Home page with uploader
│ ├── components/ # React components
│ ├── contexts/ # State management
│ ├── hooks/ # Custom hooks
│ ├── lib/ # Core logic & API integration
│ ├── types/ # TypeScript definitions
│ └── utils/ # Utility functions
├── scripts/
│ └── setup-vercel-env.sh # Environment setup helper
└── vercel.json # Vercel configuration
npm run dev # Start development server
npm run build # Build for production
npm start # Start production server
npm test # Run test suite
npm run lint # Run ESLint
MIT License - see the LICENSE file for details.