使用 ARM 同时部署多个 Azure 虚拟网络和子网时出现 AnotherOperationInProgress

AnotherOperationInProgress when deploying multiple Azure virtual networks and subnets with ARM at once

我想使用这些 vnet/子网部署虚拟网络设置

每个子网都包含在相应虚拟网络的 "resources": [...] 数组中,并且每个子网都具有 vnet 作为依赖项,如下所示:

            {
                "apiVersion": "2020-04-01",
                "type": "subnets",
                "location": "[parameters('location')]",
                "name": "ingress",
                "dependsOn": [
                    "[parameters('vnetNameCluster')]"
                ],
                "properties": {
                    "addressPrefix": "[parameters('subnetPrefixIngress')]"
                }
            }

但是在部署虚拟网络时,经常会出现冲突:

{
    "error": {
        "code": "AnotherOperationInProgress",
        "message": "Another operation on this or dependent resource is in progress. To retrieve status of the operation use uri: https://management.azure.com/subscriptions/xxxxxx/providers/Microsoft.Network/locations/westus/operations/yyyyyyyyyyyyyyy?api-version=2020-04-01.",
        "details": []
    }
}

我可以添加什么依赖项来避免这种冲突?

经过反复试验,我通过在虚拟网络中添加前一个子网作为依赖项来避免冲突 - 因此第一个子网仍然只依赖于虚拟网络:

            {
                "apiVersion": "2020-04-01",
                "type": "subnets",
                "location": "[parameters('location')]",
                "name": "agents",
                "dependsOn": [
                    "[parameters('vnetNameCluster')]",
                    "[resourceId('Microsoft.Network/virtualNetworks/subnets',parameters('vnetNameCluster'),'ingress')]"
                ],