Why Does Azure App Service Mark a Deployment Failed?
Azure App Service marks a deployment failed when its health check route returns anything other than a 200 response. The container can be running and the home page can be loading, but if the path Azure probes during deployment returns 404, the entire rollout is treated as failed. The error message often points to something unrelated to the actual cause.
I moved my portfolio from Vercel to Azure. It seemed like a good idea at the time. Here’s what happened.
Why Azure
Three reasons:
The Setup
The deployment pipeline was straightforward: Docker image pushed to Azure Container Registry (ACR), continuously deployed to an App Service, triggered by a GitHub Actions workflow on push.
It worked. Builds passed, container ran, site loaded. I moved the DNS and called it done.
The Silent Failure
Then one day, after pushing changes, the deployment broke. I didn’t notice for an entire day — the Docker image built and ran fine locally, and previous deployments had always worked.
When I finally checked the live URL, the site was down. No email notification from Azure. No alert. Just a silent failure.
Troubleshooting
I tried the obvious things:
- Rebuilt and re-pushed the image to ACR
- Tested the container on a separate VM — it worked fine
- Asked my college tech society for help
- Read through Azure’s documentation
Nothing worked. The error messages were vague and unhelpful. I temporarily pointed the DNS back to Vercel just to have a live site.
The Actual Cause
After digging through my Git history, I found it: I had removed a wildcard route that redirected unmatched paths to an error page.
{
path: "**", // Wildcard route
redirectTo: "error",
}Azure’s deployment health check pings a specific route to verify the app is running. When that route returned nothing (because the wildcard was gone), Azure marked the entire deployment as failed — even though the container was running and the home page was fine.
Re-adding the wildcard route fixed everything instantly.
Takeaways
- Set up deployment alerts. Don’t rely on manually checking the live URL.
- Azure’s health checks are opinionated. Your container running is not enough — specific routes need to respond.
- Error messages lie. The Azure error pointed to something completely unrelated to the actual cause.
- Always have a rollback plan. Keeping the Vercel deployment ready saved me from extended downtime.
This was frustrating, but it taught me more about deployment infrastructure than any tutorial could. Sometimes the best learning comes from things breaking at the worst possible time.
Frequently Asked Questions
Q1. How do I fix a failed Azure App Service deployment?
Check the deployment logs in the Azure portal, then verify that the route Azure's health check pings returns a 200. A common cause is a missing wildcard route or a 404 on the path the platform probes. Fix the route, redeploy, and confirm the health check passes.
Q2. Why does Azure App Service mark a deployment as failed when the container is running?
Azure does not just check that the container is alive. It pings a specific HTTP route and marks the rollout failed if that route does not return 200. The home page can be fine while the probed route 404s, which is why these failures are easy to miss.
Q3. How do I set up deployment alerts for Azure App Service?
Wire Azure Monitor alerts on the deployment status metric and on HTTP 5xx rates, plus an availability test on the health check route. Push those to email, Slack, or PagerDuty so a silent failure is loud within minutes, not discovered the next day.
Q4. What is the safest way to roll back a failed Azure deployment?
Keep the previous image tagged in Azure Container Registry and redeploy the prior tag through the same GitHub Actions pipeline. For App Service, slot swaps or re-deploying the last known good image are both faster than fixing forward under pressure.
Q5. Should I move a portfolio from Vercel to Azure App Service?
Only if you specifically want to learn Azure infrastructure or you have a workload that needs a long-running container. For static and JAMStack portfolios, Vercel is faster, simpler, and its build and deploy flow is far more forgiving than App Service health checks.