Unfortunately, Azure App Service’s Access Restriction feature only allows you to restrict access to the entire web app, but not to specific URL addresses.
However, you can try to achieve the scenario with two options:
- Use Application Gateway or FrontDoor resources in Azure to filter domain names or URLs.
- Use Service Endpoints. With service endpoints, to ensure inbound traffic to your API app comes only from the subnet used by your web app. The process for setting service endpoints is similar to the process for setting IP access restrictions. You can build an allow/deny list of access rules that includes public addresses and subnets in your virtual networks.
If you like to see this functionality supported on App Service in the future you can share your feedback with the App service engineering team here.
Best,
Grace