Azure FOCUS export
Have Azure Cost Management export FOCUS files to a storage container every day, give Costfluent a SAS that may only read it, and connect the container to Costfluent.
Azure Cost Management can export your cost as FOCUS files into a storage container of yours every day, and Costfluent reads that container as a FOCUS bucket on Azure Blob Storage. It is the optional second path: Connect Azure is the recommended one, with no file export to run. Connect one of the two for a subscription. When both carry the same subscription, Costfluent warns Cost counted twice: on the FOCUS bucket connection's page once the export's first rows arrive, or when the Azure connection is made after it.
Before you start
- The Costfluent access under Prerequisites.
- An Enterprise Agreement, a Microsoft Customer Agreement or a Microsoft Partner Agreement. Azure offers no FOCUS export for pay-as-you-go subscriptions.
- A role that may create exports at the scope you export, such as Owner or Contributor, and a storage account you may write to, or the right to create one.
- A storage account Costfluent can reach from the public internet: it reads the container from outside Azure.
Turn on the export
- In the Azure portal, open "Cost Management", select the scope to export, such as the billing account for every subscription it pays, and select "Exports", then "+ Create".
- On "Basics", select "Create your own export", then "Next".
- On "Datasets", select "+ Add export". Choose "Cost and usage details (FOCUS)" as the "Type of data", the newest "Dataset version", and "Daily export of month-to-date costs" as the "Frequency". Enter an "Export name", note it, and select "Add".
- On the destination tab, keep "Azure blob storage" as the "Storage type", and choose the
subscription, the resource group and the storage account. Enter a container that already exists,
or create it first under the storage account's "Containers", and a directory, such as
focus, and note both. Azure would create a new container only at the export's first run, and the SAS and the connection need it before then. - Choose "CSV" as the "Format" with "Gzip" as the "Compression type", and leave "Overwrite data" on.
- Select "Review + create", then "Create". To have the first run now instead of at the next scheduled one, open the export and select "Run now".
CSV lets Test connection sample the rows before you save. Parquet with Snappy imports as well, but the report then only counts its files.
Create a read-only key
Costfluent reads the container with a SAS that grants only Read and List, the rules the FOCUS bucket page sets under Create a read-only key.
- In the Azure portal, open the storage account, then "Containers".
- Select the export's container, open its "..." menu, and select "Generate SAS".
- Choose "Account key" as the "Signing method", one of the account's keys as the "Signing key", and "None" as the "Stored access policy".
- Under "Permissions", select only "Read" and "List".
- Set the "Expiry", and keep "Allowed protocols" at HTTPS only.
- Select "Generate SAS token and URL", and copy the "Blob SAS token", not the "Blob SAS URL". Azure shows it once.
With the Azure CLI:
Code
Connect in Costfluent
- Open Settings, then Integrations, select FOCUS bucket, open the Connect tab and select Add access key.
- Choose Azure Blob Storage as the Provider, and enter the storage account's name in Storage account.
- Enter the container in Container, and in Prefix the directory and the export's name, such
as
focus/<export name>. - Paste the "Blob SAS token" in SAS token.
- Select Test connection to see each check, or Connect to save.
You can connect before the first run: Costfluent accepts a prefix that holds no file yet.
How it behaves
- Azure exports every day into a folder per month, named for the month's first and last day, such
as
20261201-20261231. Each run holds the month so far, and with "Overwrite data" on, a month's folder keeps only the newest run. - Costfluent reads the newest run of each month in each sync's window
(Data and freshness). The
manifest.jsonAzure writes beside each run's files is skipped, never read. - In the first five days of a month, Azure also exports the month before again, and Costfluent collects that month again.
- To import months from before the export, select "Export selected dates" on the export, one month at a time.
- The SAS's expiry is the connection's: replace it in time, as Rotating or removing access describes.
Troubleshooting
- "Cost and usage details (FOCUS)" is not offered. The scope is a pay-as-you-go subscription or a management group, which Azure cannot export FOCUS for. Choose a billing account, a billing profile, an enrollment or a subscription under one of the agreements above.
- No file arrives. A run can take up to 24 hours. Select "Run now" on the export, and check its run history.
- The connection saves, but no cost arrives. The Prefix is not the folder above the monthly
folders, so Costfluent finds no file it reads there. A connection keeps its location, so remove it
and connect again with the directory and the export's name, such as
focus/<export name>. - "There is no container … in the storage account …". The container does not exist yet. Create it under the storage account's "Containers", or wait for the export's first run.
- Azure cost is counted twice. An Azure connection carries the same subscription. Remove one of the two connections.
- Every other message, the SAS messages included: Troubleshooting on the FOCUS bucket page.