【发布时间】:2018-06-22 17:24:48
【问题描述】:
我正在尝试从我构建的 ARM 模板部署 Azure AppGateway。但是我一直遇到错误:
The template variable 'appGatewayFrontendPort' is not valid: Unable to evaluate template language function 'resourceId': function requires exactly one multi-segmented argument which must be resource type including resource provider namespace. Current function arguments 'Microsoft.Network/applicationGateways/,Logis-AppGW-UK/frontendPorts/appGatewayFrontendPort'.
由于某种奇怪的原因,当我连接它时,我的 resourceID 会添加一个逗号。我在其他对象中使用了类似的 resourceID 调用,它按预期进行。附上相关的 ARM 模板。欢迎任何帮助。我试过用单个变量来做这个,它最终得到了同样的错误。如您所见,使用相同方法成功引用了 gatewaySubnetRef 变量,但我无法使其与 appGatewayfrontendPort IP 一起使用。
"variables": {
"HUBVNET": "[resourceId('Microsoft.Network/virtualNetworks',concat('VNet-Logis-HUB-',parameters('RegionCode')))]",
"LANVNet": "[resourceId('Microsoft.Network/virtualNetworks',concat('VNet-Logis-LAN-',parameters('RegionCode')))]",
"DMZVnet": "[resourceId('Microsoft.Network/virtualNetworks',concat('VNet-Logis-DMZ-',parameters('RegionCode')))]",
"StorageAccountName": "[toLower(concat('logis',parameters('RegionCode'),'storage'))]",
"DMZServersDNS": "[split(parameters('DMZ DNS Server Address'),',')]",
"LANServersDNS": "[split(parameters('LAN DNS Server Address'),',')]",
"gatewaySubnetRef": "[resourceId('Microsoft.Network/virtualNetworks/subnets', concat('VNet-Logis-HUB-',parameters('RegionCode')), 'GatewaySubnet')]",
"appGatewaySubnetRef": "[resourceId('Microsoft.Network/virtualNetworks/subnets', concat('VNet-Logis-HUB-',parameters('RegionCode')), 'AppGatewaySubnet')]",
"appGatewayPublicIPRef": "[resourceId('Microsoft.Network/publicIPAddresses/', concat('AppGW-',parameters('RegionCode'),'-PublicIP'))]",
"RecoveryServicesName": "[concat('BackupVault-Logis-',parameters('RegionCode'))]",
"AppGwFrontendPortName": "[concat('Logis-AppGW-',parameters('RegionCode'),'/frontendPorts/appGatewayFrontendPort')]",
"AppGwFrontendIP": "[concat('Logis-AppGW-',parameters('RegionCode'), '/frontendIPConfigurations/appGatewayFrontendIP')]",
"appGatewayFrontendPort": "[resourceId('Microsoft.Network/applicationGateways/', variables('AppGwFrontendPortName'))]",
"appGatewayFrontendIP": "[resourceId('Microsoft.Network/applicationGateways/', variables('AppGwFrontendIP'))]"
},
【问题讨论】:
-
我认为你缺少一个 concat( 在 appGatewayFrontendPort 和 appGatewayFrontendIP 上
标签: azure azure-resource-manager