在 ARM 模板部署期间获取 "parent resource not found"

Getting "parent resource not found" during ARM template deployment

我有私有 DNS 区域 zone.private,它已经部署在资源组中,我正在尝试使用下面的 ARM 模板向其中添加 A 记录,但失败 Status Message: Can not perform requested operation on nested resource. Parent resource 'zone.private' not found. (Code:ParentResourceNotFound) 我应该能够引用部署在同一资源组中的资源来部署嵌套资源,但由于某种原因它失败了。我将另一个名为 zone.domain.com 的区域部署到同一资源组并成功部署到该区域。

      {
         "type": "Microsoft.Network/dnsZones/A",
         "apiVersion": "2018-05-01",
         "name": "[concat('zone.private', '/', 'webexport-lb')]",
         "properties": {
            "TTL": 3600,
            "ARecords": [
               {
                  "ipv4Address": "1.1.1.1"
               }
            ]
         }
      },

如果您有私有 DNS 区域,您可以使用 Microsoft.Network/privateDnsZones/A 而不是 Microsoft.Network/dnsZones/A

所以改成这样:

  {
     "type": "Microsoft.Network/privateDnsZones/A",
     "apiVersion": "2018-09-01",
     "name": "[concat('zone.private', '/', 'webexport-lb')]",
     "properties": {
        "ttl": 3600,
        "aRecords": [
           {
              "ipv4Address": "1.1.1.1"
           }
        ]
     }
  }