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.
| Latency | Historical | Setup time |
|---|---|---|
| Daily | 90 days | 5 min |
Authentication
StackSpend uses an Azure App Registration (service principal) with the Cost Management Reader role. Do not use personal credentials.
Create an App Registration
Open the Azure Portal and navigate to Azure Active Directory → App registrations → New 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.
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.
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.
Get your Subscription ID
Navigate to Subscriptions and copy the Subscription ID for the subscription you want to connect.
Add to StackSpend
In StackSpend, go to Providers → Azure and enter the following values:
| Field | Where to find it |
|---|---|
| Tenant ID | Directory (tenant) ID from Step 1 |
| Client ID | Application (client) ID from Step 1 |
| Client Secret | Secret value from Step 2 |
| Subscription ID | Subscription ID from Step 4 |
Click Save to begin the first sync.
