Skip to main content

Set-up documentation Azure x Costory

Integrating Microsoft Azure billing data – Onboarding Guide

Grégoire Blond avatar
Written by Grégoire Blond
Updated over 3 weeks ago

What You'll Need to Provide in Costory

  • Storage Account Name

  • Container Name

  • SAS Token

Costory will auto-detect the export prefixes for both Actual and Amortized costs.


Step 1: Create a Billing Export in Azure

1.1 Access Azure Cost Management

  1. Ensure you are viewing the correct billing scope

1.2 Create an Export

  1. Click Create Export

  2. Select Cost and Usage (Actual + Amortized) template (if available)

    • Otherwise, manually create both exports:

      • Cost and Usage Reports (Actual)

      • Cost and Usage Reports (Amortized)

  3. Set Frequency to Daily export for month-to-date costs

  4. Click Next

1.3 Configure the Destination

  1. Select an export pre-fix (prefixed will be autodetected by Costory so you can choose any naming)

  2. Create or select a Storage Account

  3. Create a new container for the data (allows isolated access for Costory)

  4. Configure the export:

    • Format: Parquet

    • Compression: Snappy

    • Directory: e.g., exportCostory

    • Overwrite Data: Enable

  5. Click Create

1.4 Trigger an Immediate Export

  1. Select the export(s) you created

  2. Click Run Now

Note: The first export typically completes within 1-2 hours.


Step 2: Grant Costory Access to the Container

We'll generate a SAS token with an access policy following Azure best practices.


2.1 Locate the Storage Account

  1. Click on your export, then click the associated Storage Account

  2. Note the Storage Account Name for later

2.2 Access the Container

  1. In the storage account menu, select Containers

  2. Open the container where your exports are stored

  3. Note the Container Name for later

2.3 Set Up an Access Policy

  1. Navigate to the Access Policy tab

  2. Click Add Policy

  3. Grant permissions:

    • Read

    • List

  4. Set the time range:

    • Start time: Today

    • End time: Far enough in the future (e.g., 2+ years)

  5. Click OK and Save

2.4 Generate a SAS Token

  1. In the container menu, go to Shared Access Tokens

  2. Select the access policy you just created

  3. Click Generate SAS token and URL

  4. Copy the SAS Token (starts with ?sv=... or similar)


Step 3: Configure in Costory

  1. Go to CostoryDatasourcesBilling

  2. Click Import New Billing Datasource → Select Azure

  3. Enter your credentials:

    • Storage Account Name (e.g., mystorageaccount)

    • Container Name (e.g., costexports)

    • SAS Token (e.g., ?sv=2022-11-02&ss=b&srt=sco&sp=rl...)

  4. Click Check Available Files

  5. Costory will auto-detect your export prefixes:

    • Actual Cost Prefix (required)

    • Amortized Cost Prefix (optional, if available)

  6. Confirm or adjust the prefixes, then click Validate

  7. Click Import Datasource

Data will be available the next day.


Step 4: Trigger a Backfill (Important)

Costory features like Digest require historical data. Backfill at least 3 months, ideally from the beginning of the year.

  1. Select your export(s)

  2. Click Export selected dates

  3. Export data in 1-month chunks (Azure limitation)

  4. You can backfill up to 13 months of data

Did this answer your question?