azure - 如何使用 Get-Azmetrics 获取特定日期的存储帐户已使用容量?

标签 azure azure-storage azure-powershell

是否可以使用 Get-Azmetrics 命令获取存储帐户在特定日期或日期之间的已用容量?

我可以使用下面的命令来获取特定时间跨度的数据,但是在特定日期呢?

(Get-AzMetric -ResourceId "your_resource_id" -MetricName "UsedCapacity" -AggregationType Average -StartTime "02:00:00" -EndTime "04:00:00").Data

最佳答案

要获取特定日期和时间段的数据,您只需在 -StartTime 中指定 yyyy-MM-ddTHH:mm:ssZ 格式的日期/时间值> 和 -EndTime 参数。例如,查看下面的命令。它获取 2022 年 7 月 1 日午夜到凌晨 2:00 UTC 之间的数据。

(Get-AzMetric -ResourceId "resource-id" -MetricName "UsedCapacity" -StartTime 2022-07-01T00:00:00Z -EndTime 2022-07-01T02:00:00Z).Data

这是它产生的输出:

TimeStamp : 7/31/2022 12:00:00 AM
Average   : 4093594
Minimum   : 
Maximum   : 
Total     : 
Count     : 

TimeStamp : 7/31/2022 1:00:00 AM
Average   : 4094605
Minimum   : 
Maximum   : 
Total     : 
Count     : 

关于azure - 如何使用 Get-Azmetrics 获取特定日期的存储帐户已使用容量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73180813/

相关文章:

azure - Azure 中的密码保护测试版网站

hadoop - 在 hdinsight 配置单元编辑器上使用什么命令连接到特定存储

azure - 如何监视 Azure Blob 存储上的读写事件

powershell - Add-AzureAccount : Index was out of range. 必须是非负数且小于集合的大小

powershell - 让 Azure powershell 等待任务完成

Azure Active Directory图形API查询用户

Azure DevOps如何获取任务中的安全变量值

c# - 在 Azure 批处理中创建自定义目录

azure - 更改 Azure 资源组位置

json - Arm 模板中的 copyindex() 错误