Skip to main content
Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.

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

Connect to your Spot Account

  1. Enter an account name and click Create Account.

    Create Spot Account screen
  2. Select Microsoft Azure as your cloud provider.

  3. Select FinOps Products > Next.

  4. Select Billing Engine.

    Select Billing Engine in Spot UI
  5. Click Log in to your Azure Account.

    connect-azure-5

  6. In the Azure console, type App Registration in the search bar and click App Registrations.

    connect-azure-sub-2

  7. Click the + New registration tab.

    connect-azure-sub-3

  8. In Register Application, enter a name for the application.

  9. In the Support account types section, select Accounts in this organizational directory only (Spotinst only - Single tenant).

  10. In Redirect URI, select Web and enter https://spot.io.

    redirect URI
  11. 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.

    image

  12. Paste the Application (client) ID and Directory (tenant) ID in the fields.

    connect-azure-3
  13. Enter the agreement type:

Create Certificates and Secrets

In the previous app registration that was created, complete the following steps to create a client secret:

  1. In the left menu, click Certificates & secrets.

  2. Click the Create secrets tab and then + New client secret.

  3. Copy the secret value.

    Azure portal showing client secret value
  4. 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.

ROLEACTIONS ALLOWEDROLE DEFINITION ID
EnrollmentReaderEnrollment 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:

  1. Click the Cost Management + Billing page and select the billing account you want to connect.
  2. 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-azure-4

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:

  1. 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.

  2. Click the Billing Engine tab and then + Cloud Account.

  3. Click the Azure cloud provider you want to connect to your Spot account.

  4. Click the Existing Spot Account dropdown menu and select the Spot account you want to connect Billing Engine and click Next.

    connect-azure-6

  5. To connect your Azure billing account, start with Step 2 here.

Billing Engine checks for updated provider cost data every four hours.