Here scenario is , we have app service needs to access the azure container apps hosted as internal, that can be accessesed with the vnet.
The app gateway routing works well if we have one container app and we have achieved using below link- single container solution
if suppose we have 2 container apps , if we have /api1/--> route to container1, if we have /api2/--> route to container2.
we tried to achieve the same but it gives can't able to reach site and the health probe shows success message for both backend pool with 302 cod and as a testing purpose we use http only
Any docx to follow up or expertise on this? if yes can any one suggest best way to test the same
The best way to achieve this is by running those 2 container app as 'internal only' and creating a 3rd container app that is running a proxy of your chosing: e.g: nginx, envoy, caddy, yarp, apache, haproxy etc. and set whatever advanced routing configuration you want there. you can do pretty much whatever nginx or envoy or yarp can do at that moment. Your 'upstream' or 'target' is
http://app1andhttp://app2(or whatever you named your apps)Full example:
Here is an example nginx default.conf that routes /api1 -> app1 and /api2 -> app2
You can either build your own nginx image using
Or use the default nginx image and mount that as a file there. See this bicep template as an example https://github.com/ahmelsayed/bicep-templates/tree/main/apps/routers/nginx
It creates 3 apps, appv1 (internal) and appv2 (internal), and nginx (external), then mounts a very similar nginx config to the one above mapping
You can use the same approach with any other proxy