首页 > 解决方案 > Azure ARM 模板 - 应用程序网关 Web 应用程序防火墙配置 SelectorMatchOperator 语法

问题描述

我正在使用 ARM 模板在 Azure 中创建应用程序网关。创建 Web 应用程序防火墙配置部分时,我将在防火墙中添加排除项。我要添加的排除项之一具有“等于任何”运算符。我知道 , ,的语法Equals,但我不知道需要为“Equals Any”输入什么。containsStartsWithEndsWith

我尝试了以下示例,但由于SelectorMatchOperator不受支持,ARM 模板无法对其进行验证。如果有人知道 ARM 模板中“Equals any”的语法,我将不胜感激。谢谢。

{
  "matchVariable": "RequestCookieNames",
  "selectorMatchOperator": "EqualsAny",
  "selector": "*"
}

{
  "matchVariable": "RequestCookieNames",
  "selectorMatchOperator": "Equals_Any",
  "selector": "*"
}

{
  "matchVariable": "RequestCookieNames",
  "selectorMatchOperator": "Equals Any",
  "selector": "*"
}

{
  "matchVariable": "RequestCookieNames",
  "selectorMatchOperator": "*",
  "selector": "*"
}

{
  "matchVariable": "RequestCookieNames",
  "selectorMatchOperator": "Any",
  "selector": "*"
}

标签: azurearm-templateweb-application-firewall

解决方案


对于其他调查此问题的人。需要像下面这样设置排除项才能具有“等于任何”排除项。

{
  "matchVariable": "RequestCookieNames",
  "selectorMatchOperator": "",
  "selector": ""
}

推荐阅读