Hello @Stephen Mwanzi , Thank you for reaching out. If I have understood the question correctly you want to redirect an incoming request with a specific path
http://example.com/za to a different backend pool (a web-app) in this scenario. I think it should be possible using URL Path Based Routing as shown in this document any request for
http://contoso.com/video/* are routed to VideoServerPool, and
http://contoso.com/images/* are routed to ImageServerPool. You can associate your listener to a path based request routing rule, and based on the URL path you can match the path pattern of the request and direct it to the correct backend. Please be aware that using this rule you can match the path pattern only and not to URL's query parameters. You can follow this documentation for implementation.
Now as the backend will be a web app in this scenario. As per the documentation since app service is a multi-tenant service instead of a dedicated deployment, it uses a host header in the incoming request to resolve the request to the correct app service endpoint. Usually, the DNS name of the application, which in turn is the DNS name associated with the application gateway fronting the app service, is different from the domain name of the backend app service. Therefore, the host header in the original request received by the application gateway is not the same as the host name of the backend service. Because of this, unless the host header in the request from the application gateway to the backend is changed to the host name of the backend service, the multi-tenant backends are not able to resolve the request to the correct endpoint. Application Gateway provides a switch called
Pick host name from backend target which overrides the host header in the request with the host name of the back-end when the request is routed from the Application Gateway to the backend.
My suggestion will be test this scenario out for proof of concept before implementing it in prod environment, please let us know if you run across any issues while implementing.
Hope this helps. Please let me know if you have any additional questions or concerns I will glad to continue with our discussion.