gpt4 book ai didi

Azure ApplicationGateWay requestRoutingRules 在已定义时不会被引用

转载 作者:行者123 更新时间:2023-12-03 03:48:00 24 4
gpt4 key购买 nike

我按照应用程序网关 ARM 模板示例进行操作,发现该示例与我的脚本之间除了包含 waf 之外没有任何区别。在这里找到:https://learn.microsoft.com/en-us/azure/web-application-firewall/ag/quick-create-template

我的应用程序说资源“requestRoutingRules”找不到“httpListener”,这似乎很奇怪,因为我使用相同的变量来定义它,除非没有创建它。这些是在 APG 内部创建的,所以我无法使用 dependentOn,我现在不知道如何修复它。

2021-07-14T00:44:58.4999438Z ##[错误]InvalidResourceReference:资源...Microsoft.Network/applicationGateways/mygateway/httpListeners/testHttpListener 由.....providers/Microsoft.Network 引用未找到/applicationGateways/mygateway/requestRoutingRules/testRoutingRule。请确保引用的资源存在,并且两个资源位于同一区域。 []

请查看“httpListener”和“requestingRoutingRules”

{
"name": "[variables('applicationGatewayName')]",
"type": "Microsoft.Network/applicationGateways",
"apiVersion": "2019-09-01",
"location": "[resourceGroup().location]",
"zones": ["1"],
"dependsOn": [
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIpAdressName'))]"
],
"tags": {
"app": "test"
},
"properties": {
"sku": {
"name": "WAF_v2",
"tier": "WAF_v2"
},
"gatewayIPConfigurations": [
{
"name": "appGatewayIpConfig",
"properties": {
"subnet": {
"id": "[variables('subnetRef')]"
}
}
}
],
"frontendIPConfigurations": [
{
"name": "appGwPublicFrontendIp",
"properties": {
"PublicIPAddress": {
"id": "[variables('publicIpAdressRef')]"
}
}
}
],
"frontendPorts": [
{
"name": "port_80",
"properties": {
"Port": 80
}
}
],
"backendAddressPools": [
{
"name": "variables('backendAddressPool')",
"properties": {
"backendAddresses": [
{
"fqdn": "variables('webSiteUrl')"
}
]
}
}
],
"backendHttpSettingsCollection": [
{
"name": "variables('backendHttpSettings')",
"properties": {
"Port": 80,
"Protocol": "Http",
"cookieBasedAffinity": "Disabled",
"requestTimeout": 20,
"pickHostNameFromBackendAddress": true
}
}
],
"httpListeners": [
{
"name": "variables('httpListener')",
"properties": {
"frontendIPConfiguration": {
"id": "[concat(variables('applicationGatewayId'), '/frontendIPConfigurations/appGwPublicFrontendIp')]"
},
"frontendPort": {
"id": "[concat(variables('applicationGatewayId'), '/frontendPorts/port_80')]"
},
"protocol": "Http",
"sslCertificate": null
}
}
],
"requestRoutingRules": [
{
"Name": "testRoutingRule",
"properties": {
"RuleType": "Basic",
"httpListener": {
"id": "[resourceId('Microsoft.Network/applicationGateways/httpListeners', variables('applicationGatewayName'), variables('httpListener'))]"
},
"backendAddressPool": {
"id": "[resourceId('Microsoft.Network/applicationGateways/backendAddressPools', variables('applicationGatewayName'), variables('backendAddressPool'))]"
},
"backendHttpSettings": {
"id": "[resourceId('Microsoft.Network/applicationGateways/backendHttpSettingsCollection', variables('applicationGatewayName'), variables('backendHttpSettings'))]"
}
}
}
],
"enableHttp2": true,
"sslCertificates": [],
"probes": [],
"autoscaleConfiguration": {
"minCapacity": 0,
"maxCapacity": 10
},
"webApplicationFirewallConfiguration": {
"enabled": true,
"firewallMode": "Detection",
"ruleSetType": "OWASP",
"ruleSetVersion": "3.0"
}
}
},

最佳答案

不知道为什么在引用 httpListener 和 backendpool 等时将约定从 concat(variables... 切换到 resourceId(...) 。

我认为在创建整个应用程序网关资源时,resourceid 不起作用。

我会切换回使用名称串联来引用资源。

关于Azure ApplicationGateWay requestRoutingRules 在已定义时不会被引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68371766/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com