Hello Yasemin Aykalkan (Zer A.Ş.)
I understand that you were dealing with a complex setup involving your Azure App Service, Application Gateway, and Private Endpoints.
Based on your description, it appears you want to ensure your App Service is not publicly accessible, while allowing trusted external IPs and providing secure internal access via VPN. Here’s a summary to enhance your architecture and security:
- Configure access restriction rules on your App Service to allow access only from the Application Gateway's public IP address using IP-based restrictions.
- If you want to connect privately to the App Service, you can deploy a private endpoint and target the App Service. This will establish an internal connection only within the VNET range, allowing access only to the App Service. Check the document for private endpoints for Azure App Service apps.
- Maintain robust WAF policies to inspect incoming traffic, protecting against common threats with custom rules as needed.
- Ensure VNet peering is configured correctly if your Application Gateway and App Service are in separate VNets, and that the Application Gateway has a route to the App Service's private IP.
- If you want to connect the App Service through the Application Gateway using a Hostname, you need to configure a DNS record pointing to the Application Gateway's frontend Private IP. Only then will the traffic pass through the Application Gateway privately.
- If you want to configure a single private IP for Application Gateway in its preview state, do not use it in a production environment. You need to configure both public and private frontend IP's on Application Gateway. Reference Document Application Gateway frontend IP address configuration
- Utilize Azure AD for Identity and Access Management to ensure only authenticated users can access your App Service.
- After implementing these changes, use tools like Azure Network Watcher to monitor network traffic, ensuring only whitelisted IPs can reach your Application Gateway and that the App Service remains inaccessible directly from the internet.
- Are you using Azure VPN Gateway for your internal users to connect via VPN
Hope the above answer helps! Please let us know do you have any further queries.
Please do consider to “up-vote” wherever the information provided helps you, this can be beneficial to other community members.