Windows container stuck in "waiting for container to be ready"

Ben Gulliford 0 Reputation points
2025-01-15T20:07:48.4866667+00:00

I am trying to deploy a container to an azure app resource. I am able to run the container locally. However, when I try to deploy the app and use it, it can no longer find the certificate path. it says no file is in location "C:\app\httpsaspnetapp.pfx" (its actually located at C:\https\aspnetapp.pfx). So, I added the environment variable ENV ASPNETCORE_Kestrel__Certificates__Default__Path=c:\https\aspnetapp.pfx, along with the password. Once added, it says web app container starting up, and when I check the log stream it says "Waiting for container to be ready." Over and over again, with no more information. Could you please advise on any possible solutions to this problem?

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
724 questions
Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
512 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,225 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sina Salam 16,766 Reputation points
    2025-01-16T14:24:46.21+00:00

    Hello Ben Gulliford,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you are having an issue with Windows container stuck in "waiting for container to be ready" as it shown in the log.

    To permanently resolve the issue:

    1. Make sure that the Dockerfile correctly copies the certificate file to the expected location within the container. For example in dockerfile: COPY C:\https\aspnetapp.pfx /app/httpsaspnetapp.pfx
    2. Check that the environment variable ASPNETCORE_Kestrel__Certificates__Default__Path is set correctly in the Azure App Service configuration. You can do this through the Azure portal under the "Configuration" section of your App Service.
    3. Make sure the certificate file has the correct permissions and is accessible by the application running in the container. Sometimes, permission issues can prevent the application from accessing the file.
    4. Again, check the detailed logs of your container for any additional error messages. You can do this by navigating to the "Log stream" in the Azure portal. Look for any specific errors that might give more insight into why the container is not starting
    5. Also, double-check that the application configuration within the container is pointing to the correct certificate path. The path should match the location where the certificate file is copied within the container.
    6. Sometimes, simply restarting the Azure App Service can resolve issues with environment variables and configurations not being picked up correctly.
    7. If the issue persists, consider using Azure Key Vault to manage your certificates. Azure Key Vault can securely store and manage access to your certificates, and you can integrate it with your Azure App Service.

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.


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.