Connect Your Azure Billing Account to Billing Engine
The procedures on this page describe how to connect your Microsoft Azure Billing Account to Billing Engine.
Your account or agreement type must be either:
- Enterprise Agreement (EA)
- Microsoft Customer Agreement (MCA)
Prerequisites
- Permissions to create app registrations.
- You must be an Enterprise Agreement (EA) Administrator or Microsoft Customer Agreement (MCA) Billing Account Reader.
- A Member Account only. The account cannot be a guest user account.
Connect to your Spot Account
-
Enter an account name and click Create Account.
-
Select Microsoft Azure as your cloud provider.
-
Select FinOps Products > Next.
-
Select Billing Engine.
-
Click Log in to your Azure Account.
-
In the Azure console, type App Registration in the search bar and click App Registrations.
-
Click the + New registration tab.
-
In Register Application, enter a name for the application.
-
In the Support account types section, select Accounts in this organizational directory only (Spotinst only - Single tenant).
-
In Redirect URI, select Web and enter https://spot.io.
-
In Register an application, enter the application you registered in the previous steps and copy the Application (client) ID and Directory (tenant) ID to provide in the next step. Click Register.
-
Paste the Application (client) ID and Directory (tenant) ID in the fields.
-
Enter the agreement type:
- Enterprise Agreement Only: Select the Agreement Type Enterprise Agreement and enter the Enterprise Agreement Billing Account ID.
- Microsoft Customer Agreement Only: Select the Agreement Type Microsoft Customer Agreement and enter the Microsoft Customer Agreement Billing Account ID.
Create Certificates and Secrets
In the previous app registration that was created, complete the following steps to create a client secret:
-
In the left menu, click Certificates & secrets.
-
Click the Create secrets tab and then + New client secret.
-
Copy the secret value.
-
In the Billing Engine Wizard, paste the application secret.
Assign Enrollment Reader Role to the App Registration
Assign the enrollment reader role only for Enterprise Agreement. The Enrollment Reader Role can only be applied using a Microsoft API. Learn how to add the role using an API call.
ROLE | ACTIONS ALLOWED | ROLE DEFINITION ID |
---|---|---|
EnrollmentReader | Enrollment readers can view data at the enrollment, department, and account scopes. The data contains charges for all the subscriptions under the scopes, including across tenants. Enrollment readers can view the Azure Prepayment (previously called monetary commitment) balance associated with the enrollment. | 24f8edb6-1668-4659-b5e2-40bb5f3a7d7e |
Example of Header Input:
billingAccountName: <enrollment id>
billingRoleAssignmentName: 24f8edb6-1668-4659-b5e2-40bb5f3a7d7e
Example of Body for API Call:
{
"properties": {
"roleDefinitionId": "/providers/Microsoft.Billing/billingAccounts/<insert enrollment number>/billingRoleDefinitions/24f8edb6-1668-4659-b5e2-40bb5f3a7d7e",
"principalTenantId": "<insert Tenant ID>",
"principalId": "<insert Object Id of the service principal>"
}
}
Assign Billing Account Reader Role
Assign the billing account reader role only for Microsoft Customer Agreements.
To add the billing account reader role to the registered application:
- Click the Cost Management + Billing page and select the billing account you want to connect.
- Select the Access Control (IAM) and then add the Billing Account Reader access to the app registration.
Connect
When the validation is complete, your Azure Billing Account will be connected to Billing Engine.
Connect an Existing Spot Account
You can connect an existing Spot Account (that is not connected to Azure for other Spot products) to Billing Engine for an Azure Billing Account:
-
In the Spot console, click Billing Engine or Cost Intelligence > Administration. A list of previously registered accounts for both the Cost Intelligence and Billing Engine products opens.
-
Click the Billing Engine tab and then + Cloud Account.
-
Click the Azure cloud provider you want to connect to your Spot account.
-
Click the Existing Spot Account dropdown menu and select the Spot account you want to connect Billing Engine and click Next.
-
To connect your Azure billing account, start with Step 2 here.
Billing Engine checks for updated provider cost data every four hours.