Azure ARM 模板上的嵌套复制

Nested Copy on Azure ARM template

我需要做的是: 为仅分配了 2 个前端的每条路由 (http) 创建路由规则 再创建一个路由规则,但将所有可用的前端分配给它。

目前我正在使用这样的副本

    copy[
"name": "routingRules",
                        "count": mylengthvariable,
                        "input": {
                            "name": mynamearraywithsomeconcats,
                            "properties": {
                                "frontendEndpoints": the frontendpoint for this rule,
                                etc.. etcc
                                    }
                                }
                            }
                        }
]

一切都很好,但我需要添加另一个路由规则,但有更多的前端点;这会像这样:(这放在上面的副本之外)

 "name": "routingRules",
                        "input": {
                            "name": "extrarule",
                            "properties": {
                                "copy":[
                                    {
                                        "name" : "frontEndpoints",
                                        "count": frontendpointcount,  
                                        "input" : {
                                         "id": a list of frontendpoints
                                        }         
                                    }                                   
                                ],
                               etc.. etc..
                                
                                
                            }
                        },

当我尝试这个时,我收到了错误,因为我正在尝试添加一个规则(我认为)

我正在寻求有关如何实现这种情况的帮助。 提前致谢。

无法在 ARM 模板中执行嵌套复制(很遗憾)。您可以执行一些解决方法,例如在变量中展开子项,然后引用该变量。

可在此处找到详细信息和示例:https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/copy-resources