Skip to main content

Configuring Azure Cost Management Exports

This guide walks you through setting up Cost Management Exports in Azure. CloudYali requires daily cost exports to analyze your spending and provide cost insights.


Overview

To enable cost tracking in CloudYali, you need to:

  1. ✅ Create an Azure Storage Account (if you don't have one)
  2. ✅ Create a Blob container for cost exports
  3. ✅ Configure a Cost Management Export with daily schedule
  4. ✅ Grant your Service Principal access to the storage account

Step 1: Create Storage Account

Using Azure Portal:

  1. Go to Azure Portal → Storage accounts
  2. Click + Create
  3. Fill in the form:
    • Resource group: Select existing or create new (e.g., cloudyali-exports)
    • Storage account name: cloudyalicosts{yourname} (must be globally unique, lowercase only)
    • Region: Same as your primary resources
    • Performance: Standard
    • Redundancy: Locally-redundant storage (LRS)
  4. Click Review + CreateCreate

Create a storage account — Basics tab showing subscription, resource group, storage account name, and region fields

Create a storage account — Review + create tab showing configuration summary with LRS redundancy

After creation, the storage account overview shows your account details:

Storage account Overview page showing resource group, location, subscription, and properties

Save the storage account name - you'll need it later.


Step 2: Create Blob Container

  1. Go to the storage account you just created
  2. Click Containers in the left menu
  3. Click + Container
  4. Fill in:
    • Name: cost-exports
    • Public access level: Private
  5. Click Create

Storage account Containers page — New container dialog with Private access level

After creation, your container appears in the list:

Storage account Containers list showing the cloudyali-cost-exports container with Private access


Step 3: Configure Cost Management Export

Prerequisites (Account Type Specific):

For PAYG Accounts:

  • No special prerequisites

For MCA Accounts:

  • ⚠️ "Azure charges" setting must be enabled
  • Go to Cost Management + Billing → Billing account properties
  • Verify "Azure charges" is set to "Yes"

For EA Accounts:

  • ⚠️ Enterprise Admin must enable "Account Owner (AO) view charges"
  • Contact your Enterprise Admin if not enabled

Configure Export:

  1. Go to Cost Management + Billing
  2. Select your subscription (or billing account for MCA/EA)
  3. Click Exports under "Cost Management" in left menu
  4. Click + Add

New export — Select export template. Choose "All data" to include actual, amortized, and FOCUS cost datasets

  1. Fill in the configuration:
    • Export name: cloudyali-daily-costs
    • Export type: Daily export of month-to-date costs
    • Start date: Today
    • Storage account: Select the storage account you created
    • Container: cost-exports
    • Directory: cloudyali (optional but recommended)
    • File format: CSV
    • Compression: Gzip (optional but recommended)

New export — Export prefix and generated export names for actual, amortized, and FOCUS datasets

New export — Storage destination configuration showing storage account, container, directory, format, and compression

  1. Click Create
  1. Click the export you just created
  2. Click Run now
  3. This generates the first export immediately (instead of waiting until tomorrow)

Cost Management Exports list showing configured daily exports with Active status


Understanding Export Types: Actual vs Amortized Costs

When configuring your Cost Management Export, you'll choose between export types:

Export TypeWhat it includesBest for
Daily export of month-to-date costsActual (on-demand) costs as billedStandard cost tracking, anomaly detection
Daily export of amortized month-to-date costsReservation and savings plan costs spread across benefiting resourcesChargeback, team-level cost allocation

Our recommendation: Set up the actual costs export first (as described above). If you use Azure Reserved Instances or Savings Plans and need amortized cost views, create a second export with the amortized type pointing to the same container but a different directory:

cost-exports/
├── cloudyali/ # Actual costs (primary export)
└── cloudyali-amortized/ # Amortized costs (optional second export)
info

Azure does not include unused reservation costs in amortized views. If you need to track unused reservations for chargeback, contact support@cloudyali.io for guidance.


Step 4: Grant Storage Access to Service Principal

Now you need to give your Service Principal permission to read the exported files from storage.

Using Azure Portal:

  1. Go to the storage account
  2. Click Access Control (IAM)
  3. Click + AddAdd role assignment
  4. Select Storage Blob Data Reader role
  5. Under "Assign access to", select User, group, or service principal
  6. Search for CloudYali-Billing (your service principal name)
  7. Select it and click Review + assign

Using Azure CLI:

STORAGE_ACCOUNT_NAME="cloudyalicosts{yourname}"
RESOURCE_GROUP="cloudyali-exports"
CLIENT_ID="your-service-principal-client-id"

az role assignment create \
--assignee $CLIENT_ID \
--role "Storage Blob Data Reader" \
--scope "/subscriptions/{subscription-id}/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.Storage/storageAccounts/$STORAGE_ACCOUNT_NAME"

Step 5: Save Export Details

Save these details - you'll need them in CloudYali:

  • ✅ Storage Account Name: cloudyalicosts{yourname}
  • ✅ Container Name: cost-exports
  • ✅ Export Name: cloudyali-daily-costs
  • ✅ Directory Path: cloudyali (if specified)

Verify Export is Working

After 24-48 hours, verify that exports are being generated:

  1. Go to Cost Management + Billing
  2. Click Exports
  3. Find your export and check:
    • Status shows recent export timestamps
    • Last run was successful

Optional: Check Files in Storage

  1. Go to your Storage Account
  2. Click Containers
  3. Click cost-exports
  4. You should see folders/files like:
    • cloudyali/ (directory you specified)
    • Dated folders and CSV files inside

Troubleshooting

Issue: "No Export Files Generated After 24 Hours"

Solutions:

  1. Verify Cost Management export is configured and running
  2. Click the export and check the Run now option manually
  3. Check export frequency is set to "Daily"
  4. Verify export path matches what you'll enter in CloudYali
  5. For EA accounts, verify "AO view charges" is enabled by Enterprise Admin

Issue: "Permission Denied Reading Export Files"

Solutions:

  1. Verify Service Principal has Storage Blob Data Reader role
  2. Check storage account name in CloudYali matches Azure exactly
  3. Ensure the Service Principal was assigned the role (may take 5-10 minutes to propagate)
  4. Try using Storage Account Contributor role as alternative (more permissive)

Issue: "Export Path Not Found"

Solutions:

  1. Verify the directory path you specified in the export matches CloudYali configuration
  2. Files may not appear for 24-48 hours after export creation
  3. Run the export manually using "Run now" to generate initial files

Cost of Exports

Estimated Monthly Cost: $0.50 - $2.00

This covers:

  • Storage account costs for hosting export files
  • Blob storage read operations (when CloudYali accesses files)
  • No additional data transfer costs (internal Azure transfer)

Next Steps

Once exports are configured:

  1. ✅ Storage account created
  2. ✅ Cost export configured with daily schedule
  3. ✅ Service Principal has access to storage
  4. ➡️ Continue to Adding Account to CloudYali

Remember:

  • Initial data becomes available within 24 hours
  • Full data sync may take 24-48 hours
  • Anomaly detection becomes active after 7+ days of data