Reputation: 3
I currently have the following environment: two App Services for Container, which are two Web APIs deployed with the default domain (azurewebsites.net) and public access that currently work well, example:
Now I need to access them using Application Gateway with a result like the following:
that is, according to a path the App Gateway redirects me to the corresponding Web API and I can use the endpoints, this with the goal in the end that the Web APIs do not remain public
I followed the documentation to configure App Service with App Gateway and App Gateway with path-based routing rules but when I finish the steps and access the URLs I get a 404 Not Found
I would appreciate any additional information that I should take into account or that I am missing to carry out this configuration.
Update:
Log stream App Service:
2025-02-19T13:22:20 Welcome, you are now connected to log- streaming service.Starting Log Tail -n 10 of existing logs ----/appsvctmp/volatile/logs/runtime/container.log 2025-02-19T13:21:18.2859098Z info: Microsoft.Hosting.Lifetime[14] 2025-02-19T13:21:18.2859870Z Now listening on: http://[::]:443 2025-02-19T13:21:18.2865131Z info: Microsoft.Hosting.Lifetime[0] 2025-02-19T13:21:18.2865338Z Application started. Press Ctrl+C to shut down. 2025-02-19T13:21:18.3039270Z info: Microsoft.Hosting.Lifetime[0] 2025-02-19T13:21:18.3039765Z Hosting environment: Production 2025-02-19T13:21:18.3039796Z info: Microsoft.Hosting.Lifetime[0] 2025-02-19T13:21:18.3039888Z Content root path: /app 2025-02-19T13:21:22.9290723Z warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3] 2025-02-19T13:21:22.9293296Z Failed to determine the https port for redirect.Ending Log Tail of existing logs ---Starting Live Log Stream --- 2025-02-19T13:23:20 No new trace in the past 1 min(s).
Upvotes: 0
Views: 60
Reputation: 1556
when I finish the steps and access the URLs I get a 404 Not Found
Make sure both App Services are correctly added to the Backend Pool
in Application Gateway like below.
As you have two App service, use path-based routing rules
as shown below.
Rules-> Add multiple targets to create path-based rule -> Configure the Details ->Save.
Please refer this MS Documentation for better understanding about path-based routing
.
To know whether backend services are working fine or not, set up a Custom health probe in azure Application Gateway.
200 OK
response, Application Gateway routes traffic
to that backend.Upvotes: 0