Azure costs are not matching with the Azure portal for a finalized month. In this case, the cost in CloudHealth are higher than the cost in the Azure portal.
If costs are higher in CloudHealth compared to the Azure portal, this could be caused by a missed step in the configuration causing the costs in CloudHealth to be reported as Pay-As-You-Go (PAYG) rates.
The Azure costs rates can be verified in FlexReports with the following query:
{ "sqlStatement": "SELECT timeInterval_Month AS Month, SUM(ActualCostInReportingCurrency) AS SUM_ActualCostInReportingCurrency, AccountType AS AccountType, ChAccountId AS ChAccountId, BillingAccountId AS BillingAccountId, BillingAccountName AS BillingAccountName FROM AZURE_COST_USAGE GROUP BY timeInterval_Month, AccountType, ChAccountId, BillingAccountId, BillingAccountName", "needBackLinkingForTags": true, "dataGranularity": "MONTHLY", "timeRange": { "last": 0, "excludeCurrent": false }, "limit": -1}
There are PAYG costs in the screenshot below. If there is a ChAccountID present in the PAYG row, but not a BillingAccountID or BillingAccountName, there may be a billing account missing Reader Role permissions. In the example below, there are two different ChAccountID's but only one has a configured billing account in the tenant.
To correct this, the billing account needs to have the Service Principle with the Reader Role configured with the following steps below:
Add Service Principal as the Billing Account Reader
Assign the service principal as the billing account reader for the billing account.
Repeat these steps for each billing account. To switch your scope to a different billing account, see Switch Billing Scope in the Azure Portal.
1. Log in to the Azure Portal.
2. From the left navigation, click All services, scroll down to General section, and click Cost Management + Billing. Or, type Cost Management + Billing in the search bar and press Enter.
3. On the Cost Management page, from the left menu, select Access Control (IAM).
4. Select +Add to add a new permission.
5. Fill out the Add Permission form as follows and click Save:
- Select Billing Account Reader from the Role dropdown.
- Enter the name of the service principal in the Select field.
Once the Service Principle has been configured to the Billing Account, please open a case with Support to manually rerun the billing for the months that need adjustments.