Hi @Mazurek, Jakub
The PUT
request technically requires the full object to be included in the body.
As tested in my environment, when using a limited set of values in the request body, I received the following error:
However, when I use the full configuration (as shown below), I'm able to successfully update the Application Gateway.
{
"location": "eastus",
"tags": {
"Environment": "Production"
},
"zones": [
"1",
"2",
"3"
],
"properties": {
"sku": {
"name": "Basic",
"tier": "Basic",
"capacity": 2
},
"enableHttp2": true,
"gatewayIPConfigurations": [
{
"name": "appGatewayIpConfig",
"properties": {
"subnet": {
"id": "/subscriptions/830e5f09a9/resourceGroups/Venkat-RG/providers/Microsoft.Network/virtualNetworks/appgateway-vnet/subnets/default"
}
}
}
],
"frontendIPConfigurations": [
{
"name": "appGwPublicFrontendIpIPv4",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "/subscriptions/8332e60e5f09a9/resourceGroups/Venkat-RG/providers/Microsoft.Network/publicIPAddresses/Venkat-pip"
}
}
}
],
"frontendPorts": [
{
"name": "port_80",
"properties": {
"port": 80
}
}
],
"backendAddressPools": [
{
"name": "Venkat-pool",
"properties": {
"backendAddresses": []
}
},
{
"name": "Venkat-pool-2",
"properties": {
"backendAddresses": [
{
"ipAddress": "10.0.0.15"
},
{
"ipAddress": "10.0.0.16"
}
]
}
}
],
"backendHttpSettingsCollection": [
{
"name": "Demo",
"properties": {
"port": 80,
"protocol": "Http",
"cookieBasedAffinity": "Disabled",
"pickHostNameFromBackendAddress": false,
"requestTimeout": 20
}
}
],
"httpListeners": [
{
"name": "sample",
"properties": {
"frontendIPConfiguration": {
"id": "/subscriptions/8332bf5e60e5f09a9/resourceGroups/Venkat-RG/providers/Microsoft.Network/applicationGateways/venkat-appgateway/frontendIPConfigurations/appGwPublicFrontendIpIPv4"
},
"frontendPort": {
"id": "/subscriptions/8332bf56-7e60e5f09a9/resourceGroups/Venkat-RG/providers/Microsoft.Network/applicationGateways/venkat-appgateway/frontendPorts/port_80"
},
"protocol": "Http",
"requireServerNameIndication": false
}
}
],
"requestRoutingRules": [
{
"name": "demo-pool",
"properties": {
"ruleType": "Basic",
"priority": 100,
"httpListener": {
"id": "/subscriptions/83320e5f09a9/resourceGroups/Venkat-RG/providers/Microsoft.Network/applicationGateways/venkat-appgateway/httpListeners/sample"
},
"backendAddressPool": {
"id": "/subscriptions/8332b60e5f09a9/resourceGroups/Venkat-RG/providers/Microsoft.Network/applicationGateways/venkat-appgateway/backendAddressPools/Venkat-pool-2"
},
"backendHttpSettings": {
"id": "/subscriptions/833260e5f09a9/resourceGroups/Venkat-RG/providers/Microsoft.Network/applicationGateways/venkat-appgateway/backendHttpSettingsCollection/Demo"
}
}
}
]
}
}
Output:
You can update the rule's backend target using just a CLI command
az network application-gateway rule update -g MyResourceGroup --gateway-name MyAppGateway -n MyRule --http-listener MyNewBackendListener
This is the simplest and safest method. No full JSON body required.
If you want to use a Logic App, you can create an Automation Runbook with the above CLI cmdlet and integrate the Runbook into your Logic App, so that you can make the change through the Logic App.
I hope this helps to resolve your issue. Please feel free to ask any questions if the solution provided isn't helpful.
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.