Back to results for “Media”
.NET › CI/CD, Publishing & Deployment

What is the role of automated smoke tests and health checks immediately after a deployment completes?

Intermediate

Answer

Post-deployment smoke tests (a small suite of critical-path checks, like 'can the app respond to a basic request' or 'can it reach the database') and health check endpoint verification confirm the newly deployed version is actually functioning correctly before fully committing to it or routing significant traffic to it, catching deployment-specific issues (missing config, failed migration, broken dependency) immediately rather than discovering them from user-facing errors or alerts minutes or hours later.
# Pipeline step after deployment
- name: Smoke test
  run: |
    response=$(curl -s -o /dev/null -w "%{http_code}" https://myapp.com/health)
    if [ "$response" != "200" ]; then
      echo "Health check failed, initiating rollback"
      exit 1
    fi
Real-world example A pipeline automatically triggers a rollback to the previous deployment slot if the post-deployment smoke test against the /health endpoint doesn't return 200 within 60 seconds of the swap, catching a bad deployment before real users are affected.

Common follow-ups: What's the difference between a smoke test and a full regression test suite for this purpose?;How quickly should a rollback be triggered after a failed smoke test?