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 months ago

This document will guide you through:

  • Setting up a billing export in Azure

  • Creating a SAS token with an access policy to enable secure access to the container holding your data

What you'll need to provide to Costory:

  • SAS Token

  • Blob SAS URL

  • Container Name

  • Storage Account Name

Step 1: Create a Billing Export in Azure

  1. Access Azure Cost Management:

2. Create an Export:

  • Click on Create Export.

  • If available, select the Cost and Usage (Actual + Amortized) template

  • If not, manually create the exports:

    • Cost and Usage Reports (Actual)

    • Cost and Usage Reports (Amortized)

  • Frequency: Select Daily export for month-to-date costs.

  • Click Next.

3. Choose a Destination:

  • Create an Account Name

  • Create a new container where the data will be stored (this will allow you to grant Costory access).

  • Choose a Directory

  • Format: Choose Parquet and set the compression type to Snappy.

  • Directory: Name it something like exportCostory.

  • Enable Overwrite Data.

  • Clcik on Create

4. Trigger an Immediate Export:

  • Select the export(s) you just created and click Run Now. (Note: The initial run may take several hours.)

Step 2: Grant Costory Access to the Container

To securely provide access, we will generate a SAS token with an access policy, following best practices.

  1. Locate the Storage Account:

    • Return to the export page in Azure Cost Management.

    • Click on the export you created, then click on the associated storage account (remember to note the container name).

  2. Access the Appropriate Container:

    • In the storage account menu, select Containers and open the relevant container from the list.

3. Set Up an Access Policy:

  • Navigate to the Access Policy tab.

  • Click Add Policy and grant READ and LIST permissions.

  • Set the start time to today and the end time far enough in the future to cover your needs.

  • Click OK.

4. Generate a SAS Token:

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

  • Select the access policy you just created.

  • Once generated, save the Blob SAS Token and Blob SAS URL.

Step 3: Create the Azure BIlling Data Source on Costory

  1. Select Azure

  2. Provide all the config required.

  3. Click Next, this will test the configuration.

  4. Click Import

Note. The data will be available the next day

Step 4: Important Trigger a backfill:

To get all the benefits of the Costory platform (Digest etc... we need historic data so this process must be run for at least the past 3 months and ideally from the beginning of the year.

  1. Return to the export page in Azure Cost Management.

  2. Click on the export(s) and click on export selected dates: you will need to export data by three-month chunks. And you can backfill up to 13 months of data; (docs)

Did this answer your question?