Getting issue in ARM template while configuring backendHttpSettingsCollection. I can not use pickHostNameFromBackendAddress for both condition (true, false ), If we select True then it is throwing eror for hostname, I tried applying json('null'), but still it is throwing the same error.
Is there any way we can Implement both condition in same ARM template.
Template :
{
"name": "backendHttpSettingsCollection",
"count": "[length(parameters('backendHttpSettings'))]",
"input": {
"name": "[parameters('backendHttpSettings')[copyIndex('backendHttpSettingsCollection')].name]",
"properties": {
"port": 443,
"pickHostNameFromBackendAddress": "[parameters('backendHttpSettings')[copyIndex('backendHttpSettingsCollection')].pickHostNameFromBackendAddress]",
"hostName": "[if(parameters('backendHttpSettings')[copyIndex('backendHttpSettingsCollection')].pickHostNameFromBackendAddress, json('null') , parameters('backendHttpSettings')[copyIndex('backendHttpSettingsCollection')].hostName)]",
"protocol": "Https",
"probeEnabled": "[parameters('backendHttpSettings')[copyIndex('backendHttpSettingsCollection')].probeEnabled]",
"probe": {
"id": "[resourceId('Microsoft.Network/applicationGateways/probes', parameters('applicationGatewayName'), parameters('backendHttpSettings')[copyIndex('backendHttpSettingsCollection')].probe)]"
}
}
}
},
Parameter :
{
"name": "https-test1",
"hostName": "",
"probeEnabled": true,
"pickHostNameFromBackendAddress": true,
"probe": "slash-probe1"
},
Thanks