Azure策略附加ipSecurityRestriction

时间:2020-06-19 08:01:32

标签: azure azure-policy

我正在尝试将限制附加到App Service网络IP访问限制:

enter image description here

这是我的政策效果:

"then": {
  "effect": "append",
  "details": [
    {
      "field": "Microsoft.Web/sites/siteConfig.ipSecurityRestrictions[*]",
      "value": 
        {
          "IpAddress": "0.0.0.0/0",
          "action": "Deny",
          "tag": "Default",
          "priority": 9999,
          "name": "Test Rule"
        }
    }
  ]
}

但是,它没有附加到现有的限制数组,而是用此单个规则覆盖了它。 为什么呢?

1 个答案:

答案 0 :(得分:0)

据我所知,Azure RM API 实际上确实将数组中的对象视为不同的值。因此,当它看到 ipSecurityRestrictions 数组出现而不是进行增量更新时,它只是替换它们。这也不仅仅影响了 App Services,发现 KV Access Policies 也受到了同样的影响...

我知道这是一个老问题,但希望能提供一些结论。

编辑:在 GitHub 上找到了 Azure Policy Issue 682,这对正在利用的 api 操作起到了作用。