Hello Siddhartha Chandra, Thanks for reaching out on Microsoft Q&A and really appreciate your patience while we looked into this.
Based on the common pitfalls with ACA, the most likely solution involves correcting a misconfiguration in the ingress and application port settings.
- Use
HTTP
Transport: Ensure that the ingress transport protocol is set to HTTP and not TCP, as thecurl
command is sending an HTTP POST request. - Match the Target Port: Confirm that the ingress target port (3000) exactly matches the port that your application is listening on inside the container.
- Use
EXPOSE
in the Dockerfile: TheEXPOSE
instruction in your Dockerfile acts as documentation and helps the platform identify the container's listening port. AddEXPOSE 3000
to your Dockerfile. - Listen on Environment Variable: A best practice is to configure your application to listen on a port provided by an environment variable (e.g.,
$PORT
) instead of hardcoding3000
. This provides greater flexibility and is how many platforms, including ACA, manage container port assignments.
A corrected configuration would look something like this:
- Azure Container App Ingress Settings:
- Ingress Enabled: Yes
- Ingress Type: External
- Target Port: 3000
- Transport: HTTP
- Dockerfile:
EXPOSE 3000
CMD ["your-app-start-command", "--port", "3000"]
Related Official Documentation:
- Configure ingress in Azure Container Apps: This is the main document for understanding how to enable and configure ingress, including the differences between HTTP and TCP transport, and the importance of the targetPort.
- Troubleshoot ingress issues on Azure Container Apps: A comprehensive guide to common ingress-related problems and how to diagnose them, including port mismatches and health probe failures.
- Manage environment variables on Azure Container Apps: This document explains how to set and manage environment variables in your container app, which is a key best practice for dynamic port configuration and other settings.
- Quickstart: Deploy your first container app: A helpful starting point for new users, which demonstrates a basic deployment and configuration, including how to set up ingress from the beginning.
If the above steps resolve the issue, that’s great! If not, please help us with the following details so we can investigate further:
- Ingress Type & Transport – Is the ingress set to External or Internal? Is the transport protocol set to HTTP or TCP? (For REST APIs like Judge0, it should be HTTP.)
- Container Port Mapping – Does your Dockerfile explicitly expose port 3000 (
EXPOSE 3000
)? Is this same port set as the Target Port in ACA? - Health Probes – Are readiness and liveness probes configured? Are they passing? Failed probes can prevent traffic routing.
- Application’s Listening Port – Is the application listening on a hardcoded port (3000) or dynamically using the
$PORT
environment variable? - ACA Logs – Have you checked ACA system logs and
Revision details
for any ingress or startup errors? - Networking Setup – Is your ACA running inside a VNet with NSG/firewall rules that may be blocking inbound traffic?
Happy to assist you further once we have this information. Thanks again for your patience and for working with us on this!