我如何在ARM模板中进行内部迭代?

问题描述 投票:0回答:1

我有资源,只有在完成以下定义的NIC组之后才需要部署。如何在dependson []父资源(比如应用程序网关)中使用copy进行迭代?

{
            "apiVersion": "2017-08-01",
            "type": "Microsoft.Network/networkInterfaces",
            "name": "[concat('Winnic', copyindex())]",
            "location": "[variables('VMResourceGroupLocation')]",
            "copy": {
              "name": "WinnicLoop",
              "count": 3
            },
            "dependsOn": [
              "[parameters('virtualNetworkName')]"
            ],
            "properties": {
              "ipConfigurations": [
                {
                  "name": "ipconfig1",
                  "properties": {
                    "privateIPAllocationMethod": "Dynamic",
                    "subnet": {
                      "id": "[variables('DMZsubnetRef')]"
                    }
                }
                }
              ]
            }
          },
azure-resource-manager
1个回答
0
投票

你不能这样做(迭代内部取决于),而不是引用循环名称:

"dependsOn": [
    "WinnicLoop"
],

那样资源将取决于循环(所以循环中的所有资源)

© www.soinside.com 2019 - 2024. All rights reserved.