Skip to content

cloudwithpavan/devops-azure-github-actions-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

26 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Production-Grade CI/CD Pipeline with GitHub Actions, Terraform, and Azure Container Apps

CI/CD Terraform Docker Azure Node.js Security Monitoring Pipeline Status

This project demonstrates a production-grade DevOps CI/CD pipeline for deploying a containerized Node.js application to Microsoft Azure using modern cloud-native technologies.

The pipeline automates the full application lifecycle:

Code โ†’ Build โ†’ Security Scan โ†’ Containerize โ†’ Push โ†’ Deploy โ†’ Monitor


๐Ÿ“Œ Project Overview

This project demonstrates how a Node.js application can be deployed using a complete DevOps workflow.

Key features implemented:

  • CI/CD automation using GitHub Actions
  • Infrastructure provisioning using Terraform
  • Containerized Node.js application using Docker
  • Container vulnerability scanning using Trivy
  • Blue-Green deployment using Azure Container Apps revisions
  • Manual approval gate before production deployment
  • Monitoring and logging using Azure Monitor and Log Analytics

โญ Key DevOps Features

  • Automated CI/CD pipeline
  • Infrastructure as Code using Terraform
  • Container security scanning
  • Blue-Green deployment strategy
  • Revision-based rollback capability
  • Production approval gate
  • Monitoring and observability
  • Operations runbook

๐ŸŒ Live Application

The application is deployed using Azure Container Apps.

Example endpoint format:

https://devops-app-prod..azurecontainerapps.io


๐Ÿ— Architecture Diagram

Architecture Diagram


โš™๏ธ Architecture Workflow

Developer
   โ”‚
   โ–ผ
GitHub Repository
   โ”‚
   โ–ผ
GitHub Actions CI/CD Pipeline
   โ”‚
   โ”œโ”€โ”€ Build Node.js Application
   โ”œโ”€โ”€ Run Tests
   โ”œโ”€โ”€ Security Scan (Trivy)
   โ”œโ”€โ”€ Build Docker Image
   โ””โ”€โ”€ Push Image โ†’ Azure Container Registry
   โ”‚
   โ–ผ
Deployment Workflow
   โ”‚
   โ”œโ”€โ”€ Deploy to Dev Environment
   โ”œโ”€โ”€ Manual Approval Gate
   โ””โ”€โ”€ Deploy to Production
   โ”‚
   โ–ผ
Azure Container Apps
   โ”‚
   โ”œโ”€โ”€ Node.js Container
   โ”œโ”€โ”€ Blue-Green Deployment
   โ”œโ”€โ”€ Revision-Based Releases
   โ””โ”€โ”€ Traffic Splitting
   โ”‚
   โ–ผ
Azure Monitor + Log Analytics
   โ”‚
   โ”œโ”€โ”€ Application Logs
   โ”œโ”€โ”€ Container Metrics
   โ””โ”€โ”€ Alerts

๐Ÿงฐ Tech Stack

Technology Purpose
Node.js Application runtime
Docker Containerization
GitHub Actions CI/CD automation
Terraform Infrastructure as Code
Azure Container Registry Container image storage
Azure Container Apps Application hosting
Azure Monitor Metrics monitoring
Log Analytics Centralized logging
Trivy Container security scanning

๐Ÿ” CI/CD Pipeline Flow

1๏ธโƒฃ Developer pushes Node.js code to GitHub

2๏ธโƒฃ GitHub Actions CI pipeline starts automatically

3๏ธโƒฃ Application build and tests run

4๏ธโƒฃ Trivy scans the container image for vulnerabilities

5๏ธโƒฃ Docker image is built

6๏ธโƒฃ Image pushed to Azure Container Registry

7๏ธโƒฃ Application deployed to Dev environment

8๏ธโƒฃ Manual approval required for Production deployment

9๏ธโƒฃ Production deployment executed

๐Ÿ”Ÿ Monitoring and logs collected via Azure Monitor


๐Ÿ”„ CI/CD Pipeline Screenshot

Pipeline


๐Ÿ”ต๐ŸŸข Blue-Green Deployment Strategy

Azure Container Apps supports revision-based deployments, enabling safe releases without downtime.

Traffic can be gradually shifted between versions.

Example traffic distribution:

Revision Traffic
Stable Version 90%
New Version 10%

After validation:

Revision Traffic
New Version 100%
Old Version 0%

Rollback can be performed instantly by switching traffic back.


๐Ÿ”€ Traffic Splitting

Traffic Splitting


๐Ÿ”ต๐ŸŸข Blue-Green Deployment Screenshot

Blue Green Deployment


๐Ÿ“Š Monitoring & Observability

Monitoring is implemented using Azure Monitor and Log Analytics.

Metrics available:

  • CPU usage
  • Memory usage
  • Request metrics
  • Replica count

Logs available:

  • Node.js application logs
  • Container runtime logs
  • System logs

Example Log Analytics query:

ContainerAppConsoleLogs_CL | limit 50


๐Ÿ“ˆ Monitoring Dashboard

Container CLI Logs

Container Logs


Container Revision Details

Revision Details


Application Runtime Logs

Runtime Logs


Container Port Configuration

Container Port


Log Analytics Tables

Log Analytics Tables


Log Analytics Query Results

Log Analytics Query


Azure Monitor Metrics Dashboard

Metrics Dashboard


๐Ÿ“ฆ Infrastructure as Code

Infrastructure resources are provisioned using Terraform.

Provisioned resources include:

  • Azure Resource Group
  • Azure Container Registry
  • Azure Container App
  • Log Analytics Workspace
  • Managed Identity
  • RBAC Role Assignments

Terraform state is stored remotely using Azure Storage backend.


๐Ÿ“‚ Project Structure

devops-azure-github-actions-project

app/ Dockerfile Node.js application

terraform/ main.tf variables.tf backend.tf

.github/workflows/ pipeline.yml

screenshots/ architecture-diagram.png pipeline.png blue-green.png traffic.png

monitoring/ 01-container-cli-logs.png 02-container-revision-details.png 03-application-runtime-logs.png 04-container-port-configuration.png 05-log-analytics-tables.png 06-log-analytics-query-results.png 07-container-metrics-dashboard.png

README.md


๐Ÿ›  Operations Runbook

Restart Container App

az containerapp revision restart --name devops-app-prod --resource-group devops-gha-rg

View Application Logs

az containerapp logs show --name devops-app-prod --resource-group devops-gha-rg

Check Active Revisions

az containerapp revision list --name devops-app-prod --resource-group devops-gha-rg --output table

Rollback Deployment

az containerapp ingress traffic set --name devops-app-prod --resource-group devops-gha-rg --revision-weight devops-app-prod-0000001=100

Monitor Metrics

Key metrics available:

  • CPU usage
  • Memory usage
  • Request rate
  • Replica scaling

๐Ÿ”’ Security

Security scanning is implemented using Trivy.

The CI pipeline scans Docker images for vulnerabilities and blocks deployment if critical issues are detected.


๐Ÿ”ฎ Future Improvements

Possible enterprise enhancements:

  • Canary deployments
  • Automatic rollback based on health checks
  • Prometheus & Grafana integration
  • Multi-region deployment
  • GitOps workflow using ArgoCD
  • Automated alerting

๐Ÿค Support

If you find this project helpful:

โญ Star the repository ๐Ÿด Fork the project ๐Ÿž Open issues for improvements


๐Ÿ‘จโ€๐Ÿ’ป Author

Pavan Kumar Gummadi

DevOps Engineer | Cloud & CI/CD Enthusiast

GitHub https://github.com/cloudwithpavan

Email pavan7071@gmail.com

About

Production-grade DevOps CI/CD pipeline using GitHub Actions, Terraform, Docker, and Azure Container Apps with Blue-Green deployment, security scanning (Trivy), and Azure Monitor observability.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages