A production-style CI/CD pipeline built with Azure DevOps, automating the full lifecycle of a containerised FastAPI application — from automated testing to deployment on Azure Container Apps.
Every git push to main triggers a 3-stage pipeline: Test → Build → Deploy
| Stage | What happens |
|---|---|
| Test | pytest runs automatically — build blocked if tests fail |
| Build | Docker image built for linux/amd64 and pushed to ACR |
| Deploy | Azure Container Apps updated with new image revision |
Developer → git push → Azure DevOps Pipeline
Stage 1: pytest
Stage 2: docker buildx → ACR
Stage 3: az containerapp update
↓
Azure Container Apps
| Layer | Tool |
|---|---|
| App | Python / FastAPI |
| Containerisation | Docker (buildx — linux/amd64) |
| Container Registry | Azure Container Registry (ACR) |
| CI/CD | Azure DevOps YAML Pipelines |
| Hosting | Azure Container Apps |
| Testing | pytest |
- 3-stage YAML pipeline: Test → Build → Deploy
- Automated pytest on every push — pipeline fails fast if tests break
- Multi-platform Docker build via docker buildx
- Zero-downtime deployment via Azure Container Apps revisions
- ACR image tagged with Azure DevOps Build ID for full traceability
Pipeline successfully deployed to Azure Container Apps (Southeast Asia region). Infrastructure has been torn down to avoid ongoing costs.
Install dependencies and run: cd app pip install -r requirements.txt uvicorn main:app --reload
Run tests: cd app pytest test_main.py -v
Note : Requires Azure environment variables for full functionality

