JsonDependOn被忽略

时间:2018-11-07 18:52:38

标签: json azure powershell arm-template azure-template

嗨,我有这段代码可以部署一些虚拟机和一个vpn解决方案,但是它会在部署vnet之前先部署"vmRdsDeployment"。我尝试了dependsOn的几种不同变体,但似乎无济于事

错误是:

New-AzureRmResourceGroupDeployment : 18:38:57 - Resource Microsoft.Network/loadBalancers 'ilb-m21-m21-m21-vpn-rds' failed with message '{
  "error": {
    "code": "InvalidResourceReference",
    "message": "Resource /subscriptions/0309443f-e9d3-4974-9a9a-08a476b6ae2e/resourceGroups/RG-VPN-TEST/providers/Microsoft.Network/virtualNetworks/VNET-M21-M21-M21-VPN 
referenced by resource /subscriptions/0309443f-e9d3-4974-9a9a-08a476b6ae2e/resourceGroups/rg-vpn-test/providers/Microsoft.Network/loadBalancers/ilb-m21-m21-m21-vpn-rds 
was not found. Please make sure that the referenced resource exists, and that both resources are in the same region.",
    "details": [
      {
        "code": "NotFound",
        "message": "Resource 
/subscriptions/0309443f-e9d3-4974-9a9a-08a476b6ae2e/resourceGroups/RG-VPN-TEST/providers/Microsoft.Network/virtualNetworks/VNET-M21-M21-M21-VPN not found."
      }
    ]

模板:caches

1 个答案:

答案 0 :(得分:1)

在这种情况下,错误似乎是由于将vnet设置为不使用"condition": false进行部署,而将其更改为true后,一切正常。