使用Azure CLI为应用程序的见解设置数据保留

问题描述 投票:0回答:1

是否可以使用Azure CLI(az)为应用程序设置数据保留?

最好在使用az monitor app-insights component create创建资源期间。

azure azure-application-insights azure-cli
1个回答
0
投票

您应该使用此cli命令:az resource update

示例代码:

az resource update --resource-group your_resource_group --name appInsights_name --resource-type "microsoft.insights/components" --set properties.RetentionInDays=180

测试结果(您可能需要刷新网页,以便可以在azure门户中看到新的保留值。):

enter image description here

注意: RetentionInDays的有效值应为以下值之一:30, 60, 90, 120, 180, 270, 365, 550 or 730。参考文档为here

© www.soinside.com 2019 - 2024. All rights reserved.