0

I created an azure vnet with 2 subnets, then I created two app services inside one of the subnet. I thought the web app won't be accessible from the internet, but I can navigate to the app via it's url and the page loads.

I want to make the two website (app services) private and I'd like to use App Gateway to be the only public entry point. Could you advice how can I do that and if that's a good idea, please?

Greg
  • 25,317
  • 6
  • 53
  • 62

1 Answers1

2

Created Application gateway added two App service in backend pool:

enter image description here

Set up routing rules to define how incoming requests should be directed to the backend pool, Add listener and backend targets like below:

enter image description here

In backend setting:

enter image description here

In backend target add your path-based routing click on Add Multiple targets to create a path-based rule and configure like below:

enter image description here

Once deployed, In virtual machine add Service endpoint Microsoft.web to subnet like below:

enter image description here

In Application gateway -> healthy probes add HTTP protocol, host and appropriate path and add your backend setting like below:

enter image description here

Now, you can your backend are in healthy state

enter image description here

In backend setting make sure to select override with host name as yes and pick hostname from backend target verify the custom probe like below:

enter image description here

In app service -> under Networking -> Access restriction you can restrict app service it shows as 403 error, and you can use App Gateway to be the only public entry point.

enter image description here . enter image description here

when I hit the public Ip address in Application gateway App service are redirected successfully like below:

enter image description here

enter image description here

Reference:

Azure Application Gateway architecture with multiple App Services by Ratko cosic

Imran
  • 3,875
  • 2
  • 3
  • 12
  • That's sounds good. So now the access is private as I wanted. How can I deploy the app now? I'd like to use devops pipeline, is there any build-in way to be able to implement CI/CD to this private web service? – Greg Jul 18 '23 at 09:55
  • Hi @Greg, I think you should raise a different query in the platform as in your original question and the latest ask is a bit far-fetched. However, its good to accept the solution if it has solved the problem. This is for the benefit of the SO Community, refer SO [Link](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235) – Sourav Jul 18 '23 at 12:01