【发布时间】:2016-11-25 05:21:34
【问题描述】:
有没有办法通过使用 powershell 来获取特定资源组的计费信息(花费的时间和金钱)?
【问题讨论】:
标签: powershell azure powershell-cmdlet
有没有办法通过使用 powershell 来获取特定资源组的计费信息(花费的时间和金钱)?
【问题讨论】:
标签: powershell azure powershell-cmdlet
您可以使用 Microsoft Azure Powershell 的Get-UsageAggregates cmdlet 获取计费信息。
有关如何使用此 Cmdlet 的示例,请参阅此博客文章:http://blogs.technet.com/b/keithmayer/archive/2015/06/30/export-azure-subscription-usage-with-new-billing-api-and-powershell.aspx。
首先使用Login-AzureRmAccount cmdlet,然后使用以下命令获取数据。
Get-UsageAggregates -ReportedStartTime "2016-01-01" -ReportedEndTime "2016-01-07" -AggregationGranularity "Daily" -ShowDetails $true
使用您可以从RateCard API 获得的上述信息和数据,您也可以获得发生的成本。
【讨论】: