Azure Integration

Connect your Microsoft Azure subscriptions using App Registration and service principal authentication.

Overview

CosmosCost integrates with Microsoft Azure using the Cost Management API and Azure Resource Manager. An Azure App Registration with a service principal provides secure, auditable access to your cost and usage data.

Key Features

Service Principal Auth

Secure, auditable access via Azure AD

Read-Only Access

Cannot modify Azure resources

Cost Management API

Detailed cost breakdowns by resource

Multi-Subscription Support

Connect multiple subscriptions under one tenant

Prerequisites

  • Active Azure subscription
  • Azure AD permissions to create App Registrations
  • Ability to assign roles at subscription scope
  • CosmosCost Business or Business+ plan

Quick Setup

Step 1: Create an App Registration

  1. Open Azure Portal
  2. Navigate to Azure Active Directory → App registrations
  3. Click New registration
  4. Enter a name (e.g., CosmosCost Integration)
  5. Select Accounts in this organizational directory only
  6. Leave Redirect URI empty
  7. Click Register

Step 2: Note the Application Details

From the App Registration overview, copy:

  • Application (client) ID
  • Directory (tenant) ID

Step 3: Create a Client Secret

  1. Go to Certificates & secrets
  2. Click New client secret
  3. Add a description (e.g., "CosmosCost access")
  4. Choose expiration period (recommend 12 or 24 months)
  5. Click Add
  6. Copy the secret value immediately - it won't be shown again

Important

Copy the client secret value immediately after creation. Azure only shows it once. You'll need to create a new secret if you lose it.

Step 4: Assign Role to Service Principal

  1. Navigate to your Subscription in Azure Portal
  2. Go to Access control (IAM)
  3. Click Add → Add role assignment
  4. Select the Reader role
  5. Click Next
  6. Choose User, group, or service principal
  7. Click Select members
  8. Search for your App Registration name
  9. Select it and click Select
  10. Click Review + assign

Repeat to add the Cost Management Reader role:

  1. Click Add → Add role assignment again
  2. Select Cost Management Reader role
  3. Assign to the same service principal
  4. Click Review + assign

Step 5: Get Your Subscription ID

  1. Go to Subscriptions in Azure Portal
  2. Click on your subscription
  3. Copy the Subscription ID from the Overview page

Step 6: Connect in CosmosCost

  1. Log in to your CosmosCost dashboard
  2. Navigate to Settings → Cloud Accounts
  3. Click Add Cloud Account
  4. Select Microsoft Azure
  5. Enter the following:
    • Tenant ID
    • Subscription ID
    • Application (Client) ID
    • Client Secret
  6. Click Connect Account

Success!

Your Azure subscription is connected. Initial sync may take up to 24 hours.

Required Information Summary

FieldWhere to Find
Tenant IDAzure AD → App registrations → Your app → Overview
Subscription IDSubscriptions → Your subscription → Overview
Application (Client) IDAzure AD → App registrations → Your app → Overview
Client SecretAzure AD → App registrations → Your app → Certificates & secrets

Multi-Subscription Setup

To connect multiple Azure subscriptions:

  • Use the same App Registration for all subscriptions in a tenant
  • Assign Reader and Cost Management Reader roles on each subscription
  • Add each subscription separately in CosmosCost using the same credentials
  • Or assign roles at the Management Group level for automatic access to all subscriptions

Troubleshooting

Connection Failed

  • Verify all IDs are copied correctly
  • Check client secret hasn't expired
  • Confirm roles are assigned to service principal

No Data Appearing

  • Wait 24 hours for initial sync
  • Verify subscription has billable usage
  • Check Cost Management Reader role is assigned

Permission Errors

  • Verify roles at subscription scope
  • Wait 5-10 minutes for role propagation
  • Review Azure Activity Log for denied requests

Still having issues? Check troubleshooting guide or contact support.