DevOps

Azure DevOps: CI/CD Pipelines for Web Application Deployment

8 min read By Suraj Kumar Gorai

While GitHub Actions is my go-to for open-source projects, many enterprise clients mandate Azure DevOps. After setting up CI/CD pipelines for 8+ web applications on Azure, here are the patterns and configurations that deliver reliable, automated deployments.

Azure Pipelines vs. GitHub Actions

Azure Pipelines excels in enterprise contexts:

  • Integration with Azure services: Native deployment to App Service, Storage Accounts, CDN, and Container Registry without third-party actions.
  • Approval gates: Built-in multi-stage approval workflows for production deployments. Manager approval, QA sign-off, and change management tickets — all in the pipeline.
  • Self-hosted agents: Run build agents on your own infrastructure for compliance, network access to internal services, or specialized build environments.
  • YAML + Visual Editor: Azure supports both YAML pipelines and a visual editor, easing adoption for teams less comfortable with YAML.

Pipeline Architecture

Our standard web app pipeline has four stages:

Stage 1: Build & Validate

  • Install dependencies with locked versions (npm ci)
  • Run ESLint and TypeScript compilation in parallel
  • Execute unit tests with coverage threshold (we enforce 80%+)
  • Build the production bundle
  • Run bundle size analysis — fail if total exceeds the threshold

Stage 2: Deploy to Development

Automatic deployment on every push to develop. Deploy to Azure App Service or upload static assets to Azure Storage with CDN purge. The dev environment mirrors production configuration to catch environment-specific issues early.

Stage 3: Deploy to Staging

Triggered by PR merge to main. Includes integration tests run against the staging environment. Requires minimum one approval from the QA team before proceeding.

Stage 4: Deploy to Production

Requires explicit approval from the tech lead and product owner. Uses deployment slots for zero-downtime deployment: deploy to a staging slot, warm it up, then swap to production. If issues are detected, swap back instantly.

Static Site Deployment to Azure Storage + CDN

For SPAs and static sites, Azure Storage + CDN Front Door is a cost-effective hosting solution:

  • Upload build output to a $web container in Azure Blob Storage
  • Azure CDN profiles serve assets with edge caching globally
  • Custom domain with managed SSL certificate
  • CDN rules for SPA routing: redirect 404s to index.html
  • Cache purge in the pipeline after deployment

Total cost: ~$2/month for moderate traffic static sites, compared to $30+ for App Service.

Environment Variables & Secrets

Azure DevOps variable groups organize secrets by environment (dev, staging, prod). Key practices:

  • Link variable groups to Azure Key Vault for centralized secret management
  • Use variable group scoping so production secrets aren't available in dev pipelines
  • Mark sensitive variables as secret — they're redacted in logs and can't be echoed
  • For frontend apps: inject environment-specific config at build time via .env file generation in the pipeline

Monitoring Pipeline Health

  • Build duration tracking: If builds are getting slower, investigate — usually a dependency install or test suite growing unchecked.
  • Failure rate: Track which stage fails most frequently. If it's tests, focus on test reliability. If it's deployment, focus on environment parity.
  • Lead time: Measure time from commit to production deployment. Our target is under 30 minutes for a standard change.

Setting up Azure DevOps pipelines for your web application? Let's design a pipeline that fits your team's workflow and compliance requirements.