Reputation: 105
Is there any way to get the billing information (time and money spent) for a specific resource group by using powershell?
Upvotes: 2
Views: 6115
Reputation: 17182
You can use Get-UsageAggregates
cmdlet of Microsoft Azure Powershell to get billing information.
See this blog post for an example of how to use this Cmdlet: http://blogs.technet.com/b/keithmayer/archive/2015/06/30/export-azure-subscription-usage-with-new-billing-api-and-powershell.aspx.
First use Login-AzureRmAccount
cmdlet and then use below command to get the data.
Get-UsageAggregates -ReportedStartTime "2016-01-01" -ReportedEndTime "2016-01-07" -AggregationGranularity "Daily" -ShowDetails $true
Using above information and data which you can get from RateCard API
you can get the cost occurred as well.
Upvotes: 8