Share via

Issues setting up Access Restrictions for App Services and Application Gateway

Damian 20 Reputation points
2026-02-18T05:21:16.8633333+00:00

Hi,

We are having trouble setting up the Access Restrictions for App Services. We have an Application Gateway that routes the traffic accordingly. App Services are not exposed to the public and all traffic must go through the Application Gateway that has WAF enabled. The AG has a health probe for the App Services to check if the app is running. The issue we are currently facing is how to set up the Access Restrictions in the App Services, such that it allows certain IPs AND the health probe to work.

All unmatched rule action is set to deny, and rules that check the traffic on the AG subnet and the X-Forwarded-For header for IP whitelisting. However, this approach stops the health probe from working properly because any unmatched rule will be rejected.

Any suggestions will be appreciated. Thank you.

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

{count} votes

2 answers

Sort by: Most helpful
  1. Aditya N 2,125 Reputation points Microsoft External Staff Moderator
    2026-02-20T11:15:13.56+00:00

    Hello @Damian

    We completely understand your concern with incoming traffic. As per your requirement you need strict network control, your idea of implementing an in-app IP whitelisting might work. Please feel free to reach out to us for any assistance.

    0 comments No comments

  2. Q&A Assist
    2026-02-18T05:21:27.43+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To set up Access Restrictions for your App Services while allowing the health probe from the Application Gateway, you can consider the following approach:

    1. Allow Health Probe IPs: Ensure that you have a rule that explicitly allows the IP addresses used by the Application Gateway's health probe. You can find the IP ranges for Azure services in the service tag documentation and use those ranges in your access restriction rules.
    2. Use the X-Forwarded-For Header: Since you are already checking the X-Forwarded-For header for IP whitelisting, ensure that your rules are configured to allow the health probe's IPs through this header as well. This allows the health probe to pass through even if the unmatched rule action is set to deny.
    3. Multi-source Rules: If you have multiple IPs to allow, consider using multi-source rules to combine the health probe IPs and any other necessary IPs into a single rule. This can help simplify your configuration and ensure that all necessary traffic is allowed.
    4. Adjust Unmatched Rule Action: If the unmatched rule action is set to deny, ensure that it is the last rule in priority order. This way, your allow rules for the health probe and other necessary IPs will be evaluated first.
    5. Testing and Validation: After making changes, test the configuration to ensure that the health probe can successfully reach the App Services without being blocked by the access restrictions.

    By following these steps, you should be able to configure the Access Restrictions to allow the health probe while still maintaining security for your App Services.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.