Azure per-resource cost (Cost Management Export)
By default, CloudOptify reads Azure cost from the Cost Management query API — accurate, but rate-limited, capped at roughly a year of history, and grouped without resource-level tags. To get exact, per-resource cost with full history and tags, connect an Azure Cost Management export delivered to a storage account you own.
This is optional. Leave the export unconfigured and CloudOptify keeps using the Cost Management API exactly as it does today. Once an export is connected, CloudOptify ingests it automatically and the query API is only used as a small freshness top-up for the last day or two.
Why connect a billing export
Section titled “Why connect a billing export”The export becomes your cost backbone instead of a live API call, which unlocks a step change in both reliability and depth:
- Billing-accurate numbers. Costs come straight from the same export Azure uses to generate your invoice — no estimation, no rounding drift.
- No rate limits. Refreshes read your own storage instead of calling the throttled Cost
Management query API, so large estates stop hitting
429errors during scheduled syncs. - Deeper history. CloudOptify can provision up to 12 months of historical export runs the moment you connect — the query API caps out at roughly a year and pages slowly to get there.
- Real per-resource drill-down. Cost Explorer shows exact, billed cost per resource rather than an inventory-weighted estimate.
- Tag-based cost allocation. Cloud Groups can allocate spend by resource tag — the “business mapping” model — pulling in tagged resources across accounts, not just the ones explicitly assigned to a group.
- Cost by Region. (Enterprise) See exactly where in the world your spend lives, split by provider — for data-residency checks and catching unexpected egress.
- Top Resources. An org-wide, cross-cloud ranking of your most expensive individual resources — the fastest way to find rightsizing and cleanup targets.
Option 1: Let CloudOptify create the export for you (recommended)
Section titled “Option 1: Let CloudOptify create the export for you (recommended)”CloudOptify can create the scheduled export and backfill the last 12 months automatically, using the same service principal you already granted read access to. This is the fastest path — no manual export configuration in the Azure portal.
- In the portal, go to Cloud Connections → your Azure tenant → Set up billing export.
- Enter the storage account name and container you want the export delivered to (create an empty storage account/container first if you don’t have one — Azure docs: create a storage account).
- Click Verify & save — CloudOptify checks the service principal can read the container before saving anything.
- Click Create exports automatically. CloudOptify creates a daily FOCUS export for every active subscription under the tenant, plus one-time historical runs covering the last 12 months.
This step needs the service principal to additionally hold Cost Management Contributor on each subscription (to create the export) and Reader on the storage account’s subscription (to resolve it). Grant these the same way you granted the original read-only role — see Connect Azure.
Skip to Timing once this finishes — steps A and B below are only needed for the manual path.
Option 2: Create the export manually
Section titled “Option 2: Create the export manually”If you’d rather configure the export yourself, or your organization requires exports to be provisioned through its own change process:
A. Create the Cost Management export
Section titled “A. Create the Cost Management export”- Azure Portal → your subscription (or billing account) → Cost Management → Exports.
- + Create.
- Export name: e.g.
cloudoptify-cost-export. - Export type: FOCUS cost (recommended) — or Cost and usage details (actual/amortized) if your organization already standardizes on it. CloudOptify recognizes both formats.
- File format: CSV or Parquet — either is supported.
- Frequency: Daily export of month-to-date costs.
- Storage account: select or create the storage account and container to deliver to; note the directory path if you set one.
- Create.
For history, also run a one-time export covering the months you want backfilled — Azure exports don’t backfill automatically the way AWS Data Exports do, so without this step only data from the day you create the export onward will appear.
Note these values for CloudOptify:
| Field | Example |
|---|---|
| Storage account | mycloudoptifyexports |
| Container | cost-exports |
| Directory path (optional) | exports |
| Export name (recommended) | cloudoptify-cost-export |
B. Grant the connection’s service principal access to the storage account
Section titled “B. Grant the connection’s service principal access to the storage account”In the Azure Portal, go to the storage account → Access Control (IAM) → Add role assignment → Storage Blob Data Reader → assign it to the same app registration / service principal CloudOptify already uses for this tenant.
C. Point CloudOptify at it
Section titled “C. Point CloudOptify at it”In the portal → Cloud Connections → your Azure tenant → Set up billing export → enter the storage account, container, directory path, and export name → Verify & save. CloudOptify tests storage access before saving (it lists the container with the service principal), so a wrong name or missing role fails immediately with a clear message.
Setting the export name is optional but recommended: it scopes ingestion to that one export, so a container holding more than one export (for example both actual and amortized) can’t be double-counted.
Timing
Section titled “Timing”If you used Option 1, the historical backfill runs are queued immediately and typically land within a few hours; the daily export starts delivering from the next day. If you used Option 2 without a historical export, only data from the day the export was created forward will appear — go back and add a one-time export for the months you want backfilled.
Until the first file lands, CloudOptify keeps using the Cost Management API, and the export ingestion simply reports “no export data files found yet” — it picks up automatically once data arrives. After that, each refresh re-checks the current and previous month (the export restates the running month on every drop, which CloudOptify handles), plus a small query-API top-up for the last day or two to keep “today’s spend” current.