Tutorial: Create and manage exported data
If you read the Cost Analysis tutorial, then you're familiar with manually downloading your Cost Management data. However, you can create a recurring task that automatically exports your Cost Management data to Azure storage on a daily, weekly, or monthly basis. Exported data is in CSV format and it contains all the information that's collected by Cost Management. You can then use the exported data in Azure storage with external systems and combine it with your own custom data. And you can use your exported data in an external system like a dashboard or other financial system.
Watch the How to schedule exports to storage with Azure Cost Management video about creating a scheduled export of your Azure cost data to Azure Storage. To watch other videos, visit the Cost Management YouTube channel.
The examples in this tutorial walk you though exporting your cost management data and then verify that the data was successfully exported.
In this tutorial, you learn how to:
- Create a daily export
- Verify that data is collected
Data export is available for a variety of Azure account types, including Enterprise Agreement (EA) and Microsoft Customer Agreement customers. To view the full list of supported account types, see Understand Cost Management data. The following Azure permissions, or scopes, are supported per subscription for data export by user and group. For more information about scopes, see Understand and work with scopes.
- Owner – Can create, modify, or delete scheduled exports for a subscription.
- Contributor – Can create, modify, or delete their own scheduled exports. Can modify the name of scheduled exports created by others.
- Reader – Can schedule exports that they have permission to.
For Azure Storage accounts:
- Write permissions are required to change the configured storage account, regardless of permissions on the export.
- Your Azure storage account must be configured for blob or file storage.
If you have a new subscription, you can't immediately use Cost Management features. It might take up to 48 hours before you can use all Cost Management features.
Sign in to Azure
Sign in to the Azure portal at https://portal.azure.com.
Create a daily export
To create or view a data export or to schedule an export, open the desired scope in the Azure portal and select Cost analysis in the menu. For example, navigate to Subscriptions, select a subscription from the list, and then select Cost analysis in the menu. At the top of the Cost analysis page, select Settings, then Exports.
- Besides subscriptions, you can create exports on resource groups, management groups, departments, and enrollments. For more information about scopes, see Understand and work with scopes.
- When you're signed in as a partner at the billing account scope or on a customer's tenant, you can export data to an Azure Storage account that's linked to your partner storage account. However, you must have an active subscription in your CSP tenant.
- Select Add and type a name for the export.
- For the Metric, make a selection:
- Actual cost (Usage and Purchases) - Select to export standard usage and purchases
- Amortized cost (Usage and Purchases) - Select to export amortized costs for purchases like Azure reservations
- For Export type, make a selection:
- Daily export of month-to-date costs – Provides a new export file daily for your month-to-date costs. The latest data is aggregated from previous daily exports.
- Weekly export of cost for the last 7 days – Creates a weekly export of your costs for the past seven days from the selected start date of your export.
- Monthly export of last month's costs – Provides you with an export of your last month's costs compared to the current month that you create the export. Moving forward, the schedule runs an export on the fifth day of every new month with your previous months costs.
- One-time export – Allows you to choose a date range for historical data to export to Azure blob storage. You can export a maximum of 90 days of historical costs from the day you choose. This export runs immediately and is available in your storage account within two hours.
Depending on your export type, either choose a start date, or choose a From and To date.
- Specify the subscription for your Azure storage account, then select a resource group or create a new one.
- Select the storage account name or create a new one.
- Select the location (Azure region).
- Specify the storage container and the directory path that you'd like the export file to go to.
- Review your export details and select Create.
Your new export appears in the list of exports. By default, new exports are enabled. If you want to disable or delete a scheduled export, select any item in the list and then select either Disable or Delete.
Initially, it can take 12-24 hours before the export runs. However, it can take up longer before data is shown in exported files.
Scheduled exports are affected by the time and day of week of when you initially create the export. When you create a scheduled export, the export runs at the same frequency for each subsequent export occurrence. For example, for a daily export of month-to-date costs export set at a daily frequency, the export runs daily. Similarly for a weekly export, the export runs every week on the same day as it is scheduled. The exact delivery time of the export is not guaranteed and the exported data is available within four hours of run time.
Each export creates a new file, so older exports are not overwritten.
Create an export for multiple subscriptions
If you have an Enterprise Agreement, then you can use a management group to aggregate subscription cost information in a single container. Then you can export cost management data for the management group.
Exports for management groups of other subscription types aren't supported.
- If haven't already created a management group, create one group and assign subscriptions to it.
- In cost analysis, set the scope to your management group and select Select this management group.
- Create an export at the scope to get cost management data for the subscriptions in the management group.
Verify that data is collected
You can easily verify that your Cost Management data is being collected and view the exported CSV file using Azure Storage Explorer.
In the export list, select the storage account name. On the storage account page, select Open in Explorer. If you see a confirmation box, select Yes to open the file in Azure Storage Explorer.
In Storage Explorer, navigate to the container that you want to open and select the folder corresponding to the current month. A list of CSV files is shown. Select one and then select Open.
The file opens with the program or application that's set to open CSV file extensions. Here's an example in Excel.
Download an exported CSV data file
You can also download the exported CSV file in the Azure portal. The following steps explain how to find it from cost analysis.
- In cost analysis, select Settings, and then select Exports.
- In the list of exports, select the storage account for an export.
- In your storage account, click Containers.
- In list of containers, select the container.
- Navigate through the directories and storage blobs to the date you want.
- Select the CSV file and then select Download.
View export run history
You can view the run history of your scheduled export by selecting an individual export in the exports list page. The exports list page also provides you with quick access to view the run time of your previous exports and the next time and export will run. Here's an example showing the run history.
Select an export to view its run history.
Access exported data from other systems
One of the purposes of exporting your Cost Management data is to access the data from external systems. You might use a dashboard system or other financial system. Such systems vary widely so showing an example wouldn't be practical. However, you can get started with accessing your data from you applications at Introduction to Azure Storage.
In this tutorial, you learned how to:
- Create a daily export
- Verify that data is collected
Advance to the next tutorial to optimize and improve efficiency by identifying idle and underutilized resources.