Azure 阵列内部的Arm模板复制
我想向ActionGroup添加一系列电子邮件。在ARM模板中,我提供了一系列电子邮件:Azure 阵列内部的Arm模板复制,azure,azure-resource-manager,arm-template,Azure,Azure Resource Manager,Arm Template,我想向ActionGroup添加一系列电子邮件。在ARM模板中,我提供了一系列电子邮件: "parameters": { "actionGroup_emails":{ "type": "array" } }, 然后在ActionGroup资源中,我迭代emailReceivers属性中的电子邮件以创建接收者: { &qu
"parameters": {
"actionGroup_emails":{
"type": "array"
}
},
然后在ActionGroup资源中,我迭代emailReceivers属性中的电子邮件以创建接收者:
{
"type": "microsoft.insights/actionGroups",
"apiVersion": "2019-03-01",
"name": "[variables('appInsights_actionGroup_name')]",
"location": "Global",
"properties": {
"groupShortName": "EmailAg",
"enabled": true,
"emailReceivers": [
{
"name": "[concat(split(parameters('actionGroup_emails'),'@')[0],'_EmailAction')] ",
"emailAddress": "[parameters('actionGroup_emails')[copyIndex()]]",
"useCommonAlertSchema": false,
"copy":{
"name":"emails",
"count":"[length(parameters('actionGroup_emails'))]"
}
}
]
}
},
据我所知,我无法做到这一点,因为我没有按照文档和属性迭代资源和属性。所以我很困惑:/如果你只是像你说的那样传递一个字符串数组,你需要这样做:
"properties": {
"copy": [
{
"name": "emailReceivers",
"count": "[length(parameters('actionGroup_emails'))]",
"input": {
"name": "[concat(split(parameters('actionGroup_emails'),'@')[0],'_EmailAction')] ",
"emailAddress": "[parameters('actionGroup_emails')[copyIndex()]]",
"useCommonAlertSchema": false
}
}
]
}