通过 java sdk 自动删除 Azure 存储中的旧表
Automatically delete the old tables in Azure Storage via java sdk
我们正在使用 Azure 诊断扩展将性能指标从虚拟机发布到配置的 Azure 存储 table。 https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/diagnostics-linux#public-settings
这些指标存储在 table 中,table 名称如 WADMetricsPT1MP10DV2S2017060
table 名称是这些字符串的串联:
WADMetrics
"scheduledTransferPeriod" 用于存储在 table 中的聚合值
P10DV2S
日期,格式为 "YYYYMMDD",每 10 天更改一次
示例包括 WADMetricsPT1HP10DV2S20170410 和 WADMetricsPT1MP10DV2S20170609。
Azure 门户中是否有自动删除旧 table 的方法?
Is there a way in Azure portal to automatically delete the old tables?
很遗憾没有。您将需要手动执行此操作。
但是您可以编写一些代码并自动执行该代码。您需要做的是列出所有 table,从 table 名称中提取日期部分并确定 table 是否足够旧可以删除,然后将其删除。根据你想要的方式,你可以使用 Azure Automation、Azure Functions 或 Logic Apps 来完成自动化位。
我们正在使用 Azure 诊断扩展将性能指标从虚拟机发布到配置的 Azure 存储 table。 https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/diagnostics-linux#public-settings
这些指标存储在 table 中,table 名称如 WADMetricsPT1MP10DV2S2017060
table 名称是这些字符串的串联:
WADMetrics "scheduledTransferPeriod" 用于存储在 table 中的聚合值 P10DV2S 日期,格式为 "YYYYMMDD",每 10 天更改一次 示例包括 WADMetricsPT1HP10DV2S20170410 和 WADMetricsPT1MP10DV2S20170609。
Azure 门户中是否有自动删除旧 table 的方法?
Is there a way in Azure portal to automatically delete the old tables?
很遗憾没有。您将需要手动执行此操作。
但是您可以编写一些代码并自动执行该代码。您需要做的是列出所有 table,从 table 名称中提取日期部分并确定 table 是否足够旧可以删除,然后将其删除。根据你想要的方式,你可以使用 Azure Automation、Azure Functions 或 Logic Apps 来完成自动化位。