10-15 min setup

Connect Microsoft Azure to StackSpend

Track Azure costs using the Cost Management Query API. Supports subscription-level and management group-level cost tracking.

StackSpend connects to Azure via the Cost Management Query API with service principal authentication. Get daily cost visibility, 90 days of history, cost by subscription and service, and spend forecasting. Multi-subscription supported.

Prerequisites

  • An Azure subscription with billing enabled
  • Access to Azure Portal with subscription owner or contributor permissions
  • Azure Active Directory admin access (for app registration)
Step 1

Register an App in Azure Active Directory

Create a service principal (app registration) that StackSpend will use to authenticate and access cost data.

  1. 1Go to Azure Portal
  2. 2Navigate to Azure Active DirectoryApp registrations
  3. 3Click New registration
  4. 4Name: StackSpend Cost Reader
  5. 5Supported account types: Accounts in this organizational directory only
  6. 6Click Register
  7. 7Copy the Application (client) ID and Directory (tenant) ID - you'll need these later
Step 2

Create a Client Secret

  1. 1In the app registration, go to Certificates & secrets
  2. 2Click New client secret
  3. 3Description: StackSpend Cost Access
  4. 4Expires: Choose an appropriate expiration (e.g., 24 months)
  5. 5Click Add
  6. 6Important: Copy the Value immediately. You won't be able to see it again after leaving this page.
Step 3

Grant Cost Management Reader Role

Assign the service principal the Cost Management Reader role at the subscription or management group level.

  1. 1Go to Subscriptions (or Management groups if you want to track multiple subscriptions)
  2. 2Select your subscription (or management group)
  3. 3Click Access control (IAM)
  4. 4Click AddAdd role assignment
  5. 5Role: Cost Management Reader
  6. 6Assign access to: User, group, or service principal
  7. 7Search for and select your app: StackSpend Cost Reader
  8. 8Click Review + assignReview + assign
Step 4

Get Your Subscription ID

  1. 1Go to Subscriptions in Azure Portal
  2. 2Select your subscription
  3. 3Copy the Subscription ID (format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
Step 5

Connect in StackSpend

  1. 1Go to SettingsProviders in your StackSpend dashboard
  2. 2Click Add Provider → Select Azure
  3. 3Enter your credentials:
    • Tenant ID: Directory (tenant) ID from Step 1
    • Client ID: Application (client) ID from Step 1
    • Client Secret: Client secret value from Step 2
    • Subscription ID: Subscription ID from Step 4
  4. 4Click Test Connection to verify
  5. 5Once the test succeeds, click Connect

After Connecting

Once Azure is connected, StackSpend begins syncing historical cost data. The first sync typically takes a few minutes.

  • Costs sync automatically every 6 hours
  • Service-level and resource group-level cost breakdowns
  • Location and meter category tracking

Know where your cloud and AI spend stands — every day, starting today.

Sign up
Connect Microsoft Azure to StackSpend — Step-by-Step Guide