Microsoft Azure Enterprise Agreement (Legacy)

Important:Microsoft is deprecating the legacy Azure Enterprise Agreement (EA) APIs on May 1, 2024. Using these APIs, the Azure EA cost and usage details are imported into Cloud Cost Optimization (CCO). Your account manager will work with you to migrate to the new Azure Cost Management APIs to maintain your Azure cost reporting in Cloud Cost Optimization and ensure a seamless transition.

Cloud Cost Optimization uses bill data to provide an accurate view of your costs across accounts and services. This data is consumed by the Flexera One platform and made available for prebuilt and ad-hoc analyses. To gather the cost information, certain configuration steps must be performed with specific data and credentials being shared with Cloud Cost Optimization.

This section describes the configuration and input information needed to connect Azure Enterprise Agreement (Legacy) billing data to Cloud Cost Optimization using one of the following options:

Azure Cost Management APIs—Use this option, if your annual cloud spend is no more than $30 million USD.
Exports—Use this option, if your annual cloud spend is more than $30 million USD.

Important:If you are using the Azure Cost Management API option, you can later use Exports. However, If you are using Exports, you cannot use the Azure Cost Management API option unless you delete the existing bill connect. You must create a new bill connect to use the Azure Cost Management API.

The following steps must be completed to connect your Azure Enterprise Agreement (Legacy) billing data to Cloud Cost Optimization for cost reporting purposes:

1. Prerequisites
2. Creating Scheduled Exports in the Azure Portal

Note:This step is required only if you are using Exports.

3. Connecting Azure EA (Legacy) in Cloud Cost Optimization
4. Verifying Bill Connect
5. Viewing Import History to Verify Bill Status.

For more information about Azure Enterprise Agreement (Modern Commerce) billing data, see Microsoft Azure Enterprise Agreement (Modern Commerce).

If you are part of the Azure Cloud Solution Provider program and wish to connect your partner data to Cloud Cost Optimization for cost reporting purposes, see Microsoft Cloud Solution Provider (CSP) Partner.

Prerequisites

The following prerequisites are required to migrate to the new Cloud Cost Optimization Azure EA (Legacy) Bill Connect:

Creating Service Principal
Assigning Permission to Service Principal to Call the API
Assigning Permission to Azure Storage Account
Seeding Old Data.

Note:Consider the following:

To use the Cost Management API, you must do the following: Create service principal and assign permission to the service principal.
To use Exports, you must do the following: Create service principal, assign permission to the service principal and to the storage account, and seed the old data.

Creating Service Principal

The Azure Cost Management APIs use Azure Active Directory (Azure AD) Authentication using service principals (SPNs). For more information on creating a service principal, see Microsoft’s documentation on Create and authenticate your service principal.

The service principal requires the following details to connect to the Azure Cost Management APIs and then to Cloud Cost Optimization:

Client ID
Tenant ID
Client Secret
Billing Account ID.

Assigning Permission to Service Principal to Call the API

To use the Azure Cost Management APIs, you must assign the EnrollmentReader role permission to the service principal. You can do this by using either the Azure Cost Management API or the Azure Cloud Shell.

To assign permission to the service principal using the Azure Cost Management API:

1. Open Microsoft’s documentation on Role Assignments. Click Try It in the HTTP request block.
2. Click Sign in. Select your account that you want to use to sign in to the tenant with the enrollment access that you want to assign.

Note: You can sign in as an Enterprise Admin or as a Global Admin.

3. Enter the following parameters as part of the API request:
billingAccountName
billingRoleAssignmentName
api-version.

Note:To provide parameters as part of the API request, see Microsoft’s documentation on Assign enrollment account role permission to the SPN.

4. Enter the parameters in the request body. For information about the sample code, see Role Assignments Example.
5. Click Run. The SPN is assigned the EnrollmentReader role permission.

To assign permission to the service principal using Azure Cloud Shell:

Open Cloud Shell and paste the following code:

az rest --method put --url

https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingRoleAssignments/{billingRoleAssignmentName}\?api-version=\2019-10-01-preview --body '{"properties":{"principalId":"spn-object-id","principalTenantId":"tenant-id","roleDefinitionId":"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingRoleDefinitions/24f8edb6-1668-4659-b5e2-40bb5f3a7d7e"}}'

Note:You must enter the following values: billingAccountId, spn-object-id, and tenant-id.

Assigning Permission to Azure Storage Account

Note:This step is required only if you are using Exports.

If you are setting up a new storage account in the Azure portal, you must assign the Storage Blob Data Reader role to the storage account to access the blob data.

To assign permission to the storage account:

1. Sign in to the Azure portal (portal.azure.com) using your Azure EA account.
2. Navigate to your newly created storage account. For more information, see Creating Scheduled Exports in the Azure Portal.
3. Click Access Control (IAM). The Access Control (IAM) page appears.
4. Click Add to add the permission to the storage account. The Add role assignment page appears.
5. Search for the Storage Blob Data Reader role and assign it to the storage account.

Note:This role along with the EnrollmentReader role permission is required if you are using Exports.

Seeding Old Data

Note:This step is required only if you are using Exports.

Before you configure recurring exports in the Azure portal, if you have any old data you must seed it in the relevant folders—Actual cost and Amortized cost.

Creating Scheduled Exports in the Azure Portal

Note:This step is required only if you are using Exports.

Exports enable you to create a recurring task that automatically exports your billing data to an Azure Blob Storage on a daily, weekly, or monthly basis. The exported data is in CSV format and contains all the cost and usage data.

You can export large amounts of data with exports from Cost Management and import it into Cloud Cost Optimization.

To export data in the Azure storage account for importing it into Cloud Cost Optimization for cost reporting purposes:

1. Sign in to the Azure portal (portal.azure.com) using your Azure EA account.
2. In the upper-left corner of the Web page, click the Show portal menu icon, and then click Cost Management + Billing.
3. In the left pane, click Cost Management, and under the Settings section in the left pane, click Exports.
4. Click Add to create a new billing export. The New export page opens.
5. In the Export details section:
a. In the Name field, enter the name for your export.
b. From the Metric dropdown list, select one of the following options:
Actual cost (Usage and Purchases)—To export standard usage and purchase costs.
Amortized cost (Usage and Purchases)—To export amortized costs for purchases such as Azure reservations and Azure savings plan.

Important: You must create two exports—one for actual cost and the other for amortized cost.

c. From the Export type dropdown list, select Daily export of month-to-date costs. The latest data is aggregated from the previous daily exports.

Note:It is recommended to use the Daily export of month-to-date costs option as the Export type.

6. To split your exports into multiple files, turn on the File Partitioning toggle.
7. In the Storage section, select the Use existing or Create new option, and enter the storage account details to save your exported billing data.
8. Click Create. Your new export appears in the list of exports.

Tip:For information on creating and managing exported data, see Microsoft’s documentation on Create and manage exported data.

Connecting Azure EA (Legacy) in Cloud Cost Optimization

Important:The Manage organization role is required to connect Azure EA (Legacy) in Cloud Cost Optimization. For complete descriptions of each role available in Flexera One, see Flexera One Roles.

Cloud Cost Optimization ingests billing data provided by major cloud providers and custom bills, enabling you to allocate costs, identify waste, and perform detailed analysis of your cloud spend.

To connect Azure EA (Legacy) in Cloud Cost Optimization:

1. Go to the Billing Configuration page (Administration > Cloud Settings > Billing Configuration).
2. Click Add a Cloud Bill. The Connect Cloud - Choose your cloud dialog box opens.
3. Choose Microsoft Azure and click Continue. The Connect Cloud - Microsoft Azure dialog box opens.
4. In the Legacy contract section, Choose Azure EA (Legacy) and click Continue. The Connect Cloud - Azure EA (Legacy) dialog box opens.
5. If your annual spend is no more than $30 million USD, enter the following required information, and click Connect:
Client ID
Client Secret
Tenant ID
Billing Account ID.

Note:This means you are creating a bill connect using the Azure Cost Management API.

6. In the Start - Month/Year field, click the calendar icon (on the left side of the field) and select a date.

Note:Consider the following:

Ensure that the start month and year is equal to or greater than the Enterprise Agreement (EA) contract start date.
If you do not select the start month and year, the data is imported only for the current month.
Alternatively, if you select the start month and year, the data is imported from the specified date. Use this option to retrieve historical data and analyze information from a particular point in time.
7. If your annual spend is more than $30 million USD, you must enter the following information along with the required information, and then click Connect:
Location of unamortized export data
Location of amortized export data.

Consider the following:

These fields are required. This means you are creating a bill connect using Exports.
You must enter the location URL in the following format:

https://<Storageaccountname>.blob.core.windows.net/<Containername>/<Directorypath>/<Exportname>

Example:

https://xyzexports.blob.core.windows.net/323266/sales-buyer/actual-cost-sales-buyer

Where:

xyzexports is the storage account name.

323266 is the container name.

sales-buyer is the directory path.

actual-cost-sales-buyer is the folder name (export name) to store the actual cost.

You must create one URL for each: Actual Costs and Amortized Costs.

To submit Azure Enterprise Agreement billing data to Cloud Cost Optimization, see Using Cloud Cost Optimization API for Bill Connects.

For instructions on using Cloud Cost Optimization to add or update billing information, see Adding New Billing Data or Updating Billing Data Configurations. For instructions on connecting your cloud accounts to Automation, see Managing Credentials for Policy Access to External Systems.

Verifying Bill Connect

After you create a bill connect, you must verify the connection.

To verify bill connect in Cloud Cost Optimization:

1. Go to the Billing Processing Status page (Administration > Cloud Settings > Billing Processing Status).
2. In the Bill Account column, locate your bill account and verify the connection.

Viewing Import History to Verify Bill Status

Important:The Manage organization role is required to view the import history to verify the bill status. For complete descriptions of each role available in Flexera One, see Flexera One Roles.

After you verify the bill connect, you must verify the status of the bill.

To view import history in Cloud Cost Optimization:

1. Go to the Billing Processing Status page (Administration > Cloud Settings > Billing Processing Status).
2. In the Bill Account column, locate your bill account and click the View link. The Import History page appears.
3. In the Status column, ensure that the status of the bill is either Processing or Complete.