Hello @Rochin 5,
To troubleshoot a “502 Bad Gateway” error on your Azure Container App with ingress enabled, start by ensuring that your ingress configuration is correct, this includes setting the targetPort
to match the port your application is listening on (in your case, port 8080), and confirming that ingress is enabled with external visibility. Make sure your application is binding to 0.0.0.0:8080
, not localhost
, to ensure it can receive traffic from the ingress controller.
Next, check your container logs for any runtime errors or issues, and inspect the ingress-related diagnostics in the Azure Portal under "Diagnose and solve problems," particularly the "Container Apps Ingress Port settings check." If your container app is integrated with a virtual network, verify that it has proper DNS resolution and access to any required external services.
Also, review whether any health probes are configured, as misconfigured liveness or readiness probes could cause the app to be marked as unhealthy, resulting in a 502 error. Monitoring service health and collecting diagnostic data through Azure tools can help identify whether the problem lies with ingress routing, application configuration, or external dependencies. Following these steps should help isolate and resolve the issue.
Kindly refer below links:
Check networking and ingress settings
Troubleshoot target port settings in Azure Container Apps
If you find the answer helpful, kindly click "Accept Answer" and upvote it. If you have any further questions or concerns, please feel free to reach out to us. We are happy to assist you.