Azure Container App not starting - Python/FastAPI/Autogen (revisions/replica errors not connecting?)

NCMMCN 5 Reputation points
2025-07-11T22:17:43.42+00:00

Hello,

I'm trying to deploy a Python/FastAPI application (with Autogen) to Azure Container Apps, but the container isn't starting successfully.

The browser shows a 404 error/not loading, and logs often indicate "Could not find a replica for this app".

All environment variables have been checked and set. Dockerfile CMD/ENTRYPOINT overrides have been removed. The container attempts to start but fails during activation.

I suspect internal Python startup errors, but I'm unable to resolve it on my own. What am I doing wrong...

Any help or fresh perspectives would be greatly appreciated!

Thank you, kind regards,

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
{count} votes

1 answer

Sort by: Most helpful
  1. SUNOJ KUMAR YELURU 15,811 Reputation points MVP Volunteer Moderator
    2025-08-12T07:35:56.0466667+00:00

    Hello @NCMMCN

    The problem of an Azure Container App not starting, indicated by a 404 error and "Could not find a replica for this app" messages, can stem from various configuration issues. These include problems with the application startup command, health probes, ingress settings, dependencies, environment variables, Dockerfile practices, and revision management. Thoroughly examining the container app logs is crucial for diagnosing the root cause.

    To troubleshoot your Azure Container App:

    1.  Examine Container App Logs: Check both system and console logs for errors.
    2.  Verify Application Startup Command: Ensure the CMD or ENTRYPOINT in your Dockerfile correctly starts your FastAPI app using uvicorn.
    3.  Health Probes: Configure liveness and readiness probes to accurately reflect your application's health.
    4.  Ingress Configuration: Enable ingress and ensure the target port matches your application's listening port.
    5.  Dependency Management: Verify all dependencies are in requirements.txt and installed.
    6.  Environment Variables: Double-check names and values of environment variables.
    7.  Dockerfile Best Practices: Use a suitable base image and follow Dockerfile best practices.
    8.  Local Testing: Test your Docker image locally before deploying.
    9.  Revision Management: Ensure traffic is routed to the latest, healthy revision.

    If the Answer is helpful, please click Accept Answer and Up-Vote, so that it can help others in the community looking for help on similar topics.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.