An Azure service that provides a general-purpose, serverless container platform.
Thank you for reaching out to Microsoft Q&A.
The issue you are facing is not caused by an incorrect port configuration in your Spring Boot application or Docker image. Your application is correctly listening on port 5443, and this is validated by successful external access, localhost curl tests, and confirmed TCP connections. The problem occurs due to how Azure Container Apps uses an Envoy sidecar for ingress. Envoy performs transparent port remapping (NAT) and exposes the application internally on ephemeral ports, while your app still logically listens on 5443. However, the startup probe validation logic in Azure Container Apps checks raw socket listeners (for example /proc/net/tcp) and does not account for Envoy’s port remapping. As a result, it fails with a PortsMismatch error even though the application is healthy and serving traffic. This causes the startup probe to fail repeatedly, which in turn triggers KEDA to remove the ScaledObject and kill the container in a loop. This is a platform limitation/bug in Azure Container Apps startup probe validation when Envoy sidecar networking is involved.
Refer below points to resolve this issue or use as a workaround:
Remove the startup probe (recommended workaround) Startup probes are optional in Azure Container Apps and are not required for long‑running services. Removing the startup probe avoids the faulty port validation path entirely. Keep only readiness and liveness probes pointing to /actuator/health on port 5443. This is the most reliable and production‑safe workaround.
Rely on readiness and liveness probes only Configure HTTP readiness and liveness probes against /actuator/health using the same port. These probes work correctly because they are evaluated after the Envoy sidecar routing is established and do not perform the same raw listener validation as startup probes.
Avoid HTTP‑based scaling if startup probes are required If HTTP scaling (KEDA) is enabled and startup probes are failing, KEDA will continuously remove the revision. If your application is long‑running and not request‑driven, disable HTTP scaling and set minReplicas: 1 to prevent the revision from being deleted.
Do not attempt port changes as a fix Changing targetPort, switching between HTTP/TCP probes, using 80/443/8080, increasing probe delays, or modifying Docker EXPOSE settings will not resolve this issue. The failure is caused by Envoy’s transparent port remapping and the probe validator ignoring it.
Optional: Use internal ingress with TCP probes (advanced scenario) If public ingress is not required, switching to internal ingress and using only TCP‑based readiness checks can also bypass the problematic HTTP probe validation path.