【发布时间】:2017-10-17 14:31:36
【问题描述】:
我正在尝试将 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')]"
}
}
}
]
}
谢谢
哈里斯
【问题讨论】:
-
可以分享整个模板吗?
标签: azure azure-web-app-service azure-functions azure-application-insights