gpt4 book ai didi

ARM 模板中的 Azure Application Insights 警报规则

转载 作者:行者123 更新时间:2023-12-02 07:28:50 24 4
gpt4 key购买 nike

我正在尝试将 Application Insights 设置为附加到 Function App 和一些 Web API(Azure 应用服务)。

理想情况下,我们希望整个部署过程从 VSTS 构建和发布完全自动化,这样我们就不必从 Azure 门户设置资源。

我已为其创建了 ARM 模板,并设法让它创建 Application Insight 的新 Azure 资源,但它没有显示我想要的其他设置(即警报规则、计费类型和每日数据上限) .

当前是否可以通过 ARM 模板设置警报规则?如果是这样,有人可以帮忙验证我是否有 ARM 模板吗:)?

 {
"comments": "App Insight Alert Rule",
"type": "microsoft.insights/alertrules",
"name": "[parameters('AppInsights.AlertRuleName')]",
"apiVersion": "2014-04-01",
"location": "East US",
"tags": {
"[concat('hidden-link:/subscriptions/',subscription().subscriptionId,'/resourcegroups/',parameters('ResourceGroupName'),'/providers/microsoft.insights/components/',parameters('AppInsights.Name'))]": "Resource"
},
"properties": {
"name": "[parameters('AppInsights.AlertRuleName')]",
"description": "",
"isEnabled": true,
"condition": {
"odata.type": "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition",
"dataSource": {
"odata.type": "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource",
"resourceUri": "[resourceId('microsoft.insights/components', parameters('AppInsights.Name'))]",
"metricName": "requestFailed.count"
},
"threshold": 1,
"windowSize": "PT5M"
},
"action": {
"odata.type": "Microsoft.Azure.Management.Insights.Models.RuleEmailAction",
"customEmails": "[array(parameters('AppInsights.AlertSubscriber'))]"
}
},
"dependsOn": [
"[resourceId('microsoft.insights/components', parameters('AppInsights.Name'))]"
]
},
{

"type": "microsoft.insights/components",
"kind": "web",
"name": "[parameters('AppInsights.Name')]",
"apiVersion": "2014-04-01",
"location": "eastus",
"tags": {},
"properties": {
"ApplicationId": "[parameters('AppInsights.Name')]"
},
"dependsOn": []
},
{
"name": "[variables('billingplan')]",
"type": "microsoft.insights/components/CurrentBillingFeatures",
"location": "East US",
"apiVersion": "2015-05-01",
"dependsOn": [
"[resourceId('microsoft.insights/components', parameters('AppInsights.Name'))]"
],
"properties": {
"CurrentBillingFeatures": "[variables('pricePlan')]",
"DataVolumeCap": {
"Cap": "[parameters('AppInsights.DailyQuota')]"
}
}
}
]
}

谢谢

哈里斯

最佳答案

我终于发现问题是由于我具有相同的警报规则名称(不知道警报规则被视为资源并且需要具有唯一的名称..)。

所以我最终将警报重命名为不同的名称,重新部署解决方案,最终创建了警报规则:)。

关于ARM 模板中的 Azure Application Insights 警报规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44036527/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com