作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
{
"mode":"All",
"policyRule":{
"if":{
"allOf":[
{
"field":"type",
"equals":"Microsoft.Insights/metricalerts"
},
{
"field":"Microsoft.Insights/metricalerts/enabled",
"equals":"true"
}
]
},
"then":{
"effect":"deployIfNotExists",
"details":{
"type":"microsoft.insights/actiongroups",
"deploymentScope":"subscription",
"existenceScope":"subscription",
"existenceCondition":{
"allOf":[
{
"field":"Microsoft.Insights/metricalerts/actions[*]",
"less":"1"
}
]
},
"roleDefinitionIds":[
"/providers/microsoft.authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c"
],
"deployment":{
"location":"centralus",
"properties":{
"mode":"incremental",
"parameters":{
"actionGroupName":{
"value":"ActionGroup1"
},
"actionGroupShortName":{
"value":"AG1"
}
},
"template":{
"$schema":"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion":"1.0.0.0",
"parameters":{
"actionGroupName":{
"type":"string",
"metadata":{
"description":"Unique name (within the Resource Group) for the Action group."
}
},
"actionGroupShortName":{
"type":"string",
"metadata":{
"description":"Short name (maximum 12 characters) for the Action group."
}
}
},
"resources":[
{
"name":"[parameters('actionGroupName')]",
"type":"microsoft.insights/actionGroups",
"apiVersion":"2018-09-01",
"location":"global",
"properties":{
"groupShortName":"[parameters('actionGroupShortName')]",
"enabled":true,
"emailReceivers":[
{
"name":"TestMail",
"emailAddress":"<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c2b1a3a1aaabaceca9a3aeaba3f3f782a5afa3abaeeca1adaf" rel="noreferrer noopener nofollow">[email protected]</a>"
}
],
"smsReceivers":[
{
"name":"TestSMS",
"countryCode":"91",
"phoneNumber":"99116"
}
],
"armRoleReceivers":[
{
"name":"TestCont",
"roleId":"b24988ac-6180-42a0-ab88-20f7382dd24c"
}
]
}
}
]
}
}
}
}
}
},
"parameters":{
}
}
我正在创建一个策略并成功创建该策略,但在使用 Azure 门户中的修复任务对其进行重新修复时,它失败并提示我出现以下错误
找不到资源组“”下的资源“microsoft.insights/actiongroups/HmActionGroup”。这是策略的 Arm 模板中的资源格式。就我而言,我已将位置提供为“全局”
任何帮助将不胜感激
最佳答案
要在订阅级别进行部署,您需要在模板中使用订阅部署架构:
"$schema":"https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#"
关于azure - 未找到资源组 null 下的资源 'microsoft.insights/actiongroups/HmActionGroup',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58064391/
{ "mode":"All", "policyRule":{ "if":{ "allOf":[ { "f
我是一名优秀的程序员,十分优秀!