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
Access Azure Cost Management:
Navigate to Azure Cost Management.
Ensure you are viewing the correct billing scope!
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:
Return to Azure Cost Management.
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.
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).
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
Go to Datasources > Billing
Select Azure
Provide all the config required.
Click Next, this will test the configuration.
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.
Return to the export page in Azure Cost Management.
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)



