The following link shows a solution to the issue you are looking for. Application Gateway must be restarted after any modification to the backend server DNS entries to begin to use the new IP addresses.
In short, the following cli can help to refresh the backend pool.
az
network application-gateway address-pool update -g <rg name> -n appGatewayBackendPool --gateway-name <gw name> --servers "${appName}.azurewebsites.net"
Updates to the DNS entries of the backend pool
--please don't forget to upvote
and Accept as answer
if the reply is helpful--