Azure Cost Management exports only include data from the time they’re created forward. To analyze trends across multiple years, you’ll need to backfill historical data and merge it with your ongoing exports for reporting.
🕰️ 1. Export Historical Cost Data
📅 Option A: Use “Export Selected Dates” in the Portal
- Go to Cost Management + Billing > Exports in the Azure Portal.
- Select your export or create a new one-time export.
- Choose Export selected dates and pick a date range (up to one month per run).
- Repeat for each month you want to backfill (up to 13 months total).
✅ Result: Historical files will appear in the same container as your daily export, with folders like 20230101-20230131/
.
💻 Option B: Use the Exports REST API (for more than 13 months)
- Use the Cost Management Exports API to define one-time exports for older periods.
- Specify the desired
timePeriod
in each API call. - Run exports in monthly chunks to stay organized.
- Once complete, delete these one-time exports if they’re no longer needed.
🗂️ 2. Organize the Files in Storage
- Keep historical and ongoing exports in the same container and consistent folder structure.
- Example:
cost-exports/20230101-20230131/RunID/usage.csv
cost-exports/20250701-20250731/RunID/usage.csv
- Example:
- If needed, move or rename folders to ensure easy wildcard access during analysis.
🔄 3. Merge the Data in Power BI or Synapse
📈 In Power BI:
- Connect using the Folder connector.
- Power BI will auto-detect all files and combine them if the schema matches.
- Use Power Query to:
- Filter duplicates (e.g., overlapping December exports)
- Normalize schema if needed
💾 In Azure Synapse:
- Create an external table or view using a wildcard path: sqlCopyEdit
SELECT * FROM OPENROWSET( BULK 'https://<storage-account>.dfs.core.windows.net/<container>/cost-exports/*/usage.csv', FORMAT = 'CSV' ) AS rows
- Alternatively, use Synapse Pipelines to copy and append the data into a SQL table.
🧱 4. Normalize the Schema (If Needed)
- Check for column differences across time:
- Example:
ConsumedService
(old EA export) vsServiceName
- Tags may appear as flat columns or embedded JSON
- Example:
- Add missing columns to historical files or use Power Query to align column names.
✅ Tip: Use the same export format (e.g., Actual Cost CSV) across all exports for consistency.
🧪 5. Example Use Case
You enabled daily exports starting in July 2025 and want full data for 2024 + 2025:
- Backfill 2024 with one-time monthly exports.
- Let your daily export handle 2025 forward.
- In your BI tool, load all files, filter out overlaps (e.g., December 2024), and report on the full range.
📌 Summary
Step | Action |
---|---|
📤 Export | Use portal or API to retrieve historical files |
🗂️ Organize | Keep consistent folder paths in Storage |
🔀 Merge | Combine data using Power BI or Synapse |
🧱 Normalize | Align columns across datasets |
📊 Analyze | Build year-over-year or trend reports |
🎯 Outcome: A unified dataset combining past and present Azure billing data for complete cost visibility.