StackSpendDocs

Azure

Connect your Azure subscriptions to StackSpend via the Cost Management Query API.

What StackSpend tracks

StackSpend connects to the Azure Cost Management Query API and pulls spend at the subscription, service, and resource level. Tag-based attribution is included where tags are present on resources. Data is refreshed daily with up to 90 days of historical costs available on first sync.

LatencyHistoricalSetup time
Daily90 days5 min

Authentication

StackSpend uses an Azure App Registration (service principal) with the Cost Management Reader role. Do not use personal credentials.

1

Create an App Registration

Open the Azure Portal and navigate to Azure Active Directory App registrationsNew registration.

Set the name to StackSpend and leave the redirect URI blank. Click Register.

On the app overview page, note the Application (client) ID and the Directory (tenant) ID — you will need both later.

2

Create a client secret

In your new app registration, go to Certificates & secrets New client secret.

Set the description to StackSpend and the expiry to 24 months. Click Add.

Copy the Value immediately — it is only shown once.

Copy the secret value now.The client secret value is displayed only once at creation time. If you navigate away before copying it, you will need to delete the secret and create a new one.
3

Assign Cost Management Reader role

Navigate to Subscriptions → your subscription → Access control (IAM)Add role assignment.

Search for and select Cost Management Reader. On the Members tab, choose User, group, or service principal, then search for your app registration by name (StackSpend) and select it. Click Review + assign.

4

Get your Subscription ID

Navigate to Subscriptions and copy the Subscription ID for the subscription you want to connect.

5

Add to StackSpend

In StackSpend, go to ProvidersAzure and enter the following values:

FieldWhere to find it
Tenant IDDirectory (tenant) ID from Step 1
Client IDApplication (client) ID from Step 1
Client SecretSecret value from Step 2
Subscription IDSubscription ID from Step 4

Click Save to begin the first sync.

StackSpend Docs