Skip to main content

A Prometheus exporter for the Azure billing API

Project description

[![Build Status](](
[![Coverage Status](](
[![PyPI version](](

ACE azure-costs-exporter

Prometheus exporter for the Microsoft Azure billing API.


**azure-costs-exporter** is a web app, that is intended to be called by [Prometheus]( to export billing information from Azure. It will then return the available metrics in Prometheus compatible format.

The billing API in use is part of the "Enterprise Agreement (EA)" Portal. Hence, it is not available for pay-as-you-go
subscriptions. The configuration requires an active EA with Microsoft.


You need to create an `application.cfg` file with the following content:


- `ENROLLMENT_NUMBER` is the unique ID that identifies a particular EA.
- The `BILLING_API_ACCESS_KEY` can be created in the [EA portal]( to gain
access to the billing API. Navigate to "Reports > Download Usage" and generate an API Access Key.
- `PROMETHEUS_METRIC_NAME` is the name of the time series that will be generated in Prometheus.


E.g. via `gunicorn`. In an activated `virtualenv`, you can do:

pip install azure-costs-exporter gunicorn
cp /path/to/application.cfg .
gunicorn azure_costs_exporter:app


The used python testing tool is [pytest](
To run the tests:

mkvirtualenv billing
pip install -r requirements_dev.txt
pip install -e .

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for azure-costs-exporter, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size azure_costs_exporter-0.3.0-py2-none-any.whl (5.1 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size azure_costs_exporter-0.3.0-py3-none-any.whl (5.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size azure_costs_exporter-0.3.0.tar.gz (8.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page