This implementation provides complete Infrastructure as Code (IaC) for deploying the Three Rivers Bank Credit Card application to Azure using Azure Developer CLI (azd) with Terraform.
- azure.yaml - Main azd configuration defining services and hooks
- infra/terraform/main.tf - Complete Terraform infrastructure with Azure resources:
- Resource Group with proper naming conventions
- Azure Container Registry for Docker images
- Log Analytics Workspace for monitoring
- Container App Environment for serverless containers
- Backend Container App (Spring Boot) with environment variables
- Frontend Container App (React/Nginx) with backend integration
- infra/terraform/variables.tf - Configurable parameters for different environments
- infra/terraform/outputs.tf - Output values for application URLs and resource info
- azd-config.json - Default azd CLI configuration
-
CI workflow (.github/workflows/ci.yml):
- Builds and tests backend (Maven) and frontend (npm)
- Publishes Docker images to GitHub Container Registry
- Runs on push to main/develop/iac branches and pull requests
-
CD workflow (.github/workflows/cd.yml):
- Complete end-to-end deployment using azd CLI
- Infrastructure provisioning with Terraform
- Multi-environment support (dev/staging/production)
- Smoke testing after deployment
- Automatic cleanup on failure
- Manual deployment triggers with environment selection
- docker-compose.yml - Local development environment:
- Full application stack with networking
- Health checks for both services
- Environment variable configuration
- Quick local testing setup
-
README-AZURE-DEPLOYMENT.md - Comprehensive deployment guide:
- Prerequisites and setup instructions
- Local development workflows
- GitHub Actions configuration
- Infrastructure component details
- Monitoring and operations guide
- Troubleshooting section
- Security considerations
-
Updated README.md - Enhanced main documentation:
- Added complete Azure deployment section
- azd CLI quick start instructions
- CI/CD pipeline explanations
- Repository setup for GitHub Actions
- Management commands reference
-
azd-environments.yml - Environment-specific configurations:
- Dev, staging, and production presets
- Resource sizing recommendations
- Location and tagging strategies
# Deploy to Azure
azd up
# Local testing
docker-compose up --build- Configure repository secrets for Azure authentication
- Push to main branch triggers automatic deployment
- Manual deployment with environment selection via workflow_dispatch
- Automatic rollback on deployment failures
# Monitor applications
azd logs --service backend
azd show
# Update configuration
azd env set LOGGING_LEVEL DEBUG
azd deploy
# Scale resources
az containerapp update --min-replicas 2 --max-replicas 10
# Clean up
azd down --purge- Serverless Container Platform: Azure Container Apps provides auto-scaling, managed ingress, and zero infrastructure management
- Infrastructure as Code: Complete environment reproducibility with Terraform
- Developer Experience: Simple
azd upcommand deploys entire application - Multi-Environment: Easy promotion between dev/staging/production
- Cost Optimization: Pay-per-use scaling with automatic shutdown to zero
- Security: HTTPS-only, managed certificates, private container networking
- Monitoring: Built-in Log Analytics integration
- CI/CD Ready: GitHub Actions integration with proper secret management
| Component | CPU | Memory | Replicas | Auto-Scale |
|---|---|---|---|---|
| Backend | 0.5 vCPU | 1 GB | 1-3 | ✅ |
| Frontend | 0.25 vCPU | 0.5 GB | 1-3 | ✅ |
| Container Registry | Basic | - | - | - |
| Log Analytics | Pay-per-GB | - | - | - |
- HTTPS Only: All ingress configured for HTTPS with automatic SSL certificates
- Private Networking: Container apps communicate over private virtual network
- Secret Management: Sensitive values stored as container app secrets
- RBAC: Service principal with minimal required permissions
- No Public Database: H2 in-memory database, no external database exposure
- Custom Domain: Configure custom domain with DNS
- Azure Key Vault: Move secrets to Key Vault
- Application Insights: Add detailed application monitoring
- Azure Front Door: Global CDN and WAF protection
- Database: Migrate to Azure Database for PostgreSQL
- Blue/Green Deployment: Configure deployment slots
- Cost Management: Set up budget alerts and optimization
This implementation provides a production-ready foundation for deploying the Three Rivers Bank Credit Card application to Azure with modern DevOps practices and Infrastructure as Code.