title: Azure Application Gateway with multiple apps in a single App Service Environment backend pool
body: <p>I received in hands a project where an Azure Application Gateway (AGW) uses as backend pool an Internal Load Balancer (ILB) App Service Environment (ASE) containing multiple apps.</p>
  
  <p>The AGW is setup up using several multi-site listeners, where the host of the each multi-site listener matches a custom domain in an App Service instance running in the ILB ASE. Like this:</p>
  
  <p><a href="https://i.stack.imgur.com/ZEnGm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZEnGm.png" alt="enter image description here"></a></p>
  
  <p>I need to add a new app to the ASE and corresponding configuration to the AGW.</p>
  
  <p>The problem is that the AGW can have at maximum of 20 listeners, which has been reached in the project I received in hands. So I can't add more apps to the AGW with this setup.</p>
  
  <p>To work around the listener limitation, with minimal changes, I would like to make use of multi-site path-based routing with the ILB ASE as backend pool.
  I would like something that looks like the following:</p>
  
  <p><a href="https://i.stack.imgur.com/McdER.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/McdER.png" alt="enter image description here"></a></p>
  
  <p>I have spent some time going over the docs as well as other StackOverflow questions. I also have gone over the multi-site app service docs <a href="https://docs.microsoft.com/en-us/azure/application-gateway/create-web-app" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/application-gateway/create-web-app</a>, including playing around with the -PickHostNameFromBackend switches.
  I have made a few experiments without success so far.</p>
  
  <p>I believe that what I want to do is currently not supported by the AGW. I think I understand why. The hostname passed from the AGW to the ILB ASE (api.example.com) is not present as custom domain in any of the App Service instances in the ASE, so the request will not be fulfilled. Correct me if I am wrong please.</p>
  
  <p>Is my desired setup (Figure 2) possible ?</p>
  
  <p>If not possible, what would be alternative solutions, with only one AGW as I have today?</p>