gpt4 book ai didi

azure - 未找到资源组 null 下的资源 'microsoft.insights/actiongroups/HmActionGroup'

转载 作者:行者123 更新时间:2023-12-03 04:08:45 24 4
gpt4 key购买 nike

{
"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 门户中的修复任务对其进行重新修复时,它失败并提示我出现以下错误

enter image description here

找不到资源组“”下的资源“microsoft.insights/actiongroups/HmActionGroup”。这是策略的 Arm 模板中的资源格式。就我而言,我已将位置提供为“全局”

enter image description here

任何帮助将不胜感激

最佳答案

要在订阅级别进行部署,您需要在模板中使用订阅部署架构:

"$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/

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