Documentation
Getting Started
Azure Cost Estimator connects to your Azure subscriptions via service principals to analyze spending patterns and identify cost optimization opportunities.
Prerequisites
- An active Azure subscription
- Azure AD application with Reader access to target subscriptions
- Node.js 18+ or Python 3.10+ for the CLI tool
Installation
Using npm
npm install -g @azure-cost-estimator/cli
Using pip
pip install azure-cost-estimator
Docker
docker pull ghcr.io/azure-cost-estimator/ace:latest
docker run -e AZURE_TENANT_ID=xxx -e AZURE_CLIENT_ID=xxx ace
Configuration
Create a ace.config.yaml file in your project root:
tenant_id: "your-tenant-id"
subscriptions:
- "subscription-id-1"
- "subscription-id-2"
alerts:
budget_threshold: 1000
anomaly_detection: true
notification_emails:
- admin@company.com
export:
format: csv
schedule: weekly
API Reference
The REST API is available at https://api.vikingbild.se/v2/
Authentication
All API requests require a Bearer token obtained via OAuth 2.0 client credentials flow.
curl -X POST https://api.vikingbild.se/v2/auth/token \
-H "Content-Type: application/json" \
-d '{"client_id": "xxx", "client_secret": "xxx"}'
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /v2/costs | Retrieve cost data for a date range |
| GET | /v2/forecasts | Get cost forecasts |
| GET | /v2/recommendations | List optimization recommendations |
| POST | /v2/alerts | Create budget alerts |
| GET | /v2/reports | Generate cost reports |
FAQ
How often is cost data updated?
Cost data is refreshed every 4 hours from Azure Cost Management APIs. Real-time usage data may take up to 24 hours to appear.
Which Azure services are supported?
All Azure services that report costs through the Azure Cost Management API are supported, including VMs, Storage, Databases, App Services, AKS, and more.
Can I export data?
Yes. Reports can be exported in CSV, JSON, or PDF format via the API or the web dashboard.