"startup probe failed: connection refused" on Azure Container App with Azure Files volume

Daniel Cuellar 0 Reputation points
2025-04-21T17:02:41.7+00:00

I have an Azure Container App that is a Web API in .NET 6 and has a volume associated with Azure Files to the /app/wwwroot folder and for a few weeks now when trying to start a new review it throws the error "startup probe failed: connection refused" and that configuration had been working for a year, the source code is functional, the Docker image compiles well and uploads to the Container Registry, the volume configuration has not changed, it works fine locally, it only fails when starting the review in Azure, why is it failing now?

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
660 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Arko 3,090 Reputation points Microsoft External Staff Moderator
    2025-05-05T07:37:44.61+00:00

    Hello Daniel Cuellar,

    Thanks for providing all the detailed context, configuration, and logs. I reviewed the behavior you've described and also went through the logs you shared from the ContainerAppSystemLogs_CL table. The issue appears to consistently occur when your Azure Container App tries to start with the Azure Files volume mounted to /app/wwwroot, and the error "startup probe failed: connection refused" follows shortly after the container is created.

    Based on the symptoms and the fact that the app launches fine without the Azure Files volume, it looks like to me a regression or timing issue introduced recently when mounting Azure Files to system-critical paths like /app/wwwroot. The container may be trying to start the ASP.NET Core app before the volume is fully mounted and ready, especially if the runtime is expecting to read from or write to that path during startup. This behavior aligns with recent issues reported on the Azure Container Apps GitHub repository, where mounting Azure Files to /app/wwwroot leads to container startup failures or readiness probe timeouts.

    One workaround you can try is to avoid mounting Azure Files directly to /app/wwwroot. Instead, try mounting the volume to a different path inside the container, such as /mnt/azurefiles, and adjust your application code if needed to reference files from that new location. This prevents potential interference with the ASP.NET hosting environment, which uses /app/wwwroot internally to serve static files and perform initialization tasks. If you must use files during startup, consider adding logic to copy them into /app/wwwroot after ensuring the volume is ready, or delay access to the volume until after the app is fully initialized.

    I understand that your setup has been working for a year, and it's frustrating when something breaks without any configuration changes. However, this looks very likely to be a timing or mounting regression on the Azure platform side affecting certain paths. Mounting to a non-critical path like /mnt/azurefiles should give your application a stable environment to initialize correctly without hitting startup probe failures.

    Let me know if trying that helps resolve the issue. Thanks

    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.