How to pull cost per Meter Category and Meter Sub Category out of CloudHealth
search cancel

How to pull cost per Meter Category and Meter Sub Category out of CloudHealth

book

Article ID: 431513

calendar_today

Updated On:

Products

CloudHealth

Issue/Introduction

If you need to retrieve cost per Meter Category and Meter Sub Category you can do so via FlexReporting.

Resolution

Find the following FlexReport stub that pulls Meter Category, Meter Sub Category, Resource ID, and Actual Cost in Billing Currency below, these fields can be changed as required this simply serves as a stub to get you started  - 

{
  "sqlStatement": "SELECT timeInterval_Month AS Month, MeterCategory AS MeterCategory, MeterSubCategory AS MeterSubCategory, ResourceId AS ResourceId, SUM(ActualCostInBillingCurrency) AS SUM_ActualCostInBillingCurrency FROM AZURE_COST_USAGE GROUP BY timeInterval_Month, MeterCategory, MeterSubCategory, ResourceId",
  "needBackLinkingForTags": true,
  "dataGranularity": "MONTHLY",
  "timeRange": {
    "last": 3
  },
  "limit": -1
}

To deploy the stub FlexReport please follow these steps:

  1. Copy the query you wish to deploy by accessing the FlexReport, and expanding the Report Query section. Within this section select the Copy option.



  2. Switch to the tenant you wish to deploy the FlexReport to, and select Reports -> FlexReports -> New FlexReport.

  3. Within the page displayed expand the Report Query section, and select the Edit option, and paste the query copied in Step 1. 



  4. Give the report a name and then select the Save & View Report option.