It seems that while you’ve increased the timeout in the backend, the Application Gateway’s idleTimeoutInMinutes setting, which defaults to 4 minutes, might still be limiting the connection. Ideally, you should increase this timeout as well.
az network public-ip update
--ids /subscriptions//resourceGroups/<resource_group>/providers/Microsoft.Network/publicIPAddresses/
--idle-timeout 30