title: Azure App Service behind Azure Application Gateway
body: <p>I'm trying to serve multiple Azure App Services behind an Application Gateway. These services should only be reachable through the application gateway endpoint. To achieve this, I've done the following:</p>
  
  <ul>
  <li>Added a VNet</li>
  <li>Added a subnet, and added all app services to it</li>
  <li>Added an application gateway with appropriate rules for pointing to the app service</li>
  <li>Added access restrictions to the app service to only allow the subnet of the application gateway, and the public IP of the application gateway</li>
  </ul>
  
  <p>The health probe of the application gateway indicates the service is healthy (and thus reachable), but when I try to make a request to the service trough the gateway using Postman, I get a <code>403 IP forbidden</code> error. However, when I add my local IP as an allowed IP address to the app service, the request comes through just fine</p>
  
  <p>From what I've read online, adding the public IP of the gateway should be sufficient for allowing access through the gateway, but it seems that requests from my local machine are blocked. Am I getting something fundamentally wrong here?</p>
  
  <p><strong>Edit:</strong> I also tried assigning a front-end private IP address to the gateway and adding access for that in the app service, but that also did not work</p>
  
  <p><strong>Edit 2: My configuration</strong></p>
  
  <p>Access restrictions for app service:
  <a href="https://i.stack.imgur.com/7pLQT.png" rel="nofollow noreferrer">access restrictions</a></p>
  
  <p>Backend pool:
  <a href="https://i.stack.imgur.com/vZcVs.png" rel="nofollow noreferrer">Backend pool</a></p>
  
  <p>HTTP settings:
  <a href="https://i.stack.imgur.com/LLUu7.png" rel="nofollow noreferrer">HTTP settings</a></p>
  
  <p>Listener:
  <a href="https://i.stack.imgur.com/R5R2U.png" rel="nofollow noreferrer">Listener</a></p>
  
  <p>Rule:
  <a href="https://i.stack.imgur.com/gAsFw.png" rel="nofollow noreferrer">Rule</a></p>