I have found the solution through ARM template. If anyone facing similar kind of issue here are the details:
As I didn't find any ps command to add new rule in existing path based rule, we can add completely new rule using Add-AzApplicationGatewayUrlPathMapConfig but I want to just add new path based condition. below is json template that has 2 rules:
"urlPathMaps": [
{
"name": "urlPathMap1",
"properties": {
"defaultBackendAddressPool": {
"id": "[concat(variables('applicationGatewayID'), '/backendAddressPools/appGatewayBackendPoolDefault')]"
},
"defaultBackendHttpSettings": {
"id": "[concat(variables('applicationGatewayID'), '/backendHttpSettingsCollection/appGatewayBackendHttpSettings')]"
},
"pathRules": [
{
"name": "pathRule1",
"properties": {
"paths": [
"[parameters('pathMatch1')]"
],
"backendAddressPool": {
"id": "[concat(variables('applicationGatewayID'), '/backendAddressPools/appGatewayBackendPool1')]"
},
"backendHttpSettings": {
"id": "[concat(variables('applicationGatewayID'), '/backendHttpSettingsCollection/appGatewayBackendHttpSettings')]"
}
}
},
{
"name": "pathRule2",
"properties": {
"paths": [
"[parameters('pathMatch2')]"
],
"backendAddressPool": {
"id": "[concat(variables('applicationGatewayID'), '/backendAddressPools/appGatewayBackendPool2')]"
},
"backendHttpSettings": {
"id": "[concat(variables('applicationGatewayID'), '/backendHttpSettingsCollection/appGatewayBackendHttpSettings')]"
}
}
}
]
}
}
]
we can add another rule to add new path condition in existing app gateway, here is github link for complete sample template.
Hope this will help someone.
Thanks.