Skip to content

How-To Guides

Azure CLI Authentication

  • Install Azure CLI - Command line tool by specifing your attended OS.
  • ensure your account have sufficient permission as Billing Reader or Usage Billing Contributor to manage Azure billing.
  • Check installed package by:
az --version
  • Authenticate using your Azure account:
az login

This will open the portal in your default browser to authenticate.

Check installed Python version

  • Ensure you Python version is >= 3.12.3 by:
python --version

# Consider update Python version if less than 3

Install eraXplor

  • Install eraxplor too by:
pip install eraXplor

How-To use

eraXplor-azure have multiple arguments set with a default values -explained below-, Adjsut these arguments as required.

eraXplor-azure <--start-date [yyyy,MM,DD]> <--end-date [yyyy,MM,DD]> \
<--group-by [subscription | ServiceName | ResourceGroupName]> \
<--granularity [Daily | Monthly]> \
<--output [FILE_NAME.CSV]>

For Windows/PowerShell users restart your terminal, and you may need to use the following command:

python3 -m eraXplor-azure

# Or
python -m eraXplor-azure

# to avoid using this command, apend the eraXplor to your paths.
# Normaly its under: C:\Users\<YourUser>\AppData\Local\Programs\Python\Python<version>\Scripts\

Argument Reference

Argument Short Description Default
--start-date -s Start date (YYYY,MM,DD format) 3 months ago
--end-date -e End date (YYYY,MM,DD format) Today
--group-by -g Grouping dimension subscription
--granularity -G Time aggregation Monthly
--out -o Output CSV filename az_cost_report.csv

Group By Options

  • subscription: Group costs by Azure subscription (default)
  • ServiceName: Group costs by Azure service name (e.g. Virtual Machines, Storage)
  • ResourceGroupName: Group costs by Resource Group

Granularity Options

  • Monthly: Aggregate costs by month (default)
  • Daily: Show daily cost breakdown

Advanced Usage Examples

Export Costs by Service Name

Identify which Azure services are driving costs across all subscriptions:

eraXplor-azure -g ServiceName -G Monthly -o service_costs.csv

Export Costs by Resource Group

Analyze costs by Resource Group for tagging compliance and FinOps:

eraXplor-azure -g ResourceGroupName -G Monthly -o resourcegroup_costs.csv

Daily Cost Breakdown

Get granular daily cost data for the last 30 days:

eraXplor-azure -s 2025,02,01 -e 2025,03,01 -G Daily -o daily_costs.csv
Note

Ensure you run the command in a place you have sufficient permission to replace file. The eraXport tool sorting cost reult into a CSV file, by default The CSV will replace for next run.