Azure Usage Details Version 2 in Powershell

Jason Allen 6 Reputation points
2020-11-16T19:05:49.027+00:00

Is there an AZ cmdlet to automate pulling the same data that is found in the "Usage Details Version 2" Azure report?

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
2,568 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. olufemia-MSFT 2,861 Reputation points
    2020-11-17T16:54:19.44+00:00

    Hello @Jason Allen , I recommend exploring the Get-AzConsumptionUsageDetail cmdlet, part of the Az.Billing PS module to see if it meets your automation needs.
    Here are some examples. More details here.

    Get-AzConsumptionUsageDetail -Expand MeterDetails -Top 10  
    AccountName:  AAAA  
    BillingPeriodId:  subscriptions/1caaa5a3-2b66-438e-8ab4-bce37d518c5d/providers/Microsoft.Billing/billingPeriods/20180601  
    ConsumedService:  Microsoft.Compute  
    CostCenter:  XYZ987  
    Currency:  USD  
    DepartmentName:  Ama  
    Id:  subscriptions/1caaa5a3-2b66-438e-8ab4-bce37d518c5d/providers/Microsoft.Billing/billingPeriods/20180601/providers/Microsoft.Consumption/usageDetails/24b9dff0-f022-55a1-886b-17b330000db3  
    InstanceId:  subscriptions/1caaa5a3-2b66-438e-8ab4-bce37d518c5d/resourceGroups/MAR-CCM/providers/Microsoft.Compute/disks/mar-ccm-vm01_OsDisk_1_d0beead4b6ff4b4088a687701d355d61  
    InstanceLocation:  usnorthcentral  
    InstanceName:  mar-ccm-vm01_OsDisk_1_d0beead4b6ff4b4088a687701d355d61  
    IsEstimated:  true  
    MeterDetails:  MeterCategory:  Data Management  
                   MeterLocation:  usnorthcentral  
                   MeterName:  Standard Managed Disk Operations (in 10,000s)  
                   MeterSubCategory:  Data Management  
                   Unit:  Operations  
    MeterId:  82cd70ab-1aee-4b30-bc04-8b71e1204dbc  
    Name:  24b9dff0-f022-55a1-886b-17b330000db3  
    PretaxCost:  0  
    Product:  Data Management Standard Managed Disk Operations  
    SubscriptionGuid:  1caaa5a3-2b66-438e-8ab4-bce37d518c5d  
    SubscriptionName:  CCM - Microsoft Azure Enterprise - 1  
    Type:  Microsoft.Consumption/usageDetails  
    UsageEnd:  6/1/2018 11:59:59 PM  
    UsageQuantity:  3.8218  
    UsageStart:  6/1/2018 12:00:00 AM  
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.