This project demonstrates how to containerize a Spring Boot application and deploy it to Azure Container Instances (ACI) using Azure DevOps CI/CD pipelines.
- Java 17 + Spring Boot
- Maven
- Docker
- Azure Container Registry (ACR)
- Azure Container Instances (ACI)
- Azure DevOps Pipelines
- Containerized a Spring Boot app using Docker
- Continuous Integration with Maven + Docker image build
- Continuous Deployment to Azure Container Instance
- Environment-agnostic and scalable pipeline
- Health check support (optional)
Before you begin, ensure you have:
- Azure Account
- Azure DevOps Account
- Git, Java 17, Maven installed locally
- Docker installed (optional for local testing)
springboot-azure-deploy/
├── src/ # Spring Boot source files
├── target/ # Maven build output
├── Dockerfile # Container configuration
├── pom.xml # Project dependencies & build settings
├── azure-pipelines.yml # CI pipeline (Build + Push)
├── aci-deploy.yml # CD pipeline (Deploy to ACI)
└── README.md
git clone https://dev.azure.com/<org>/<project>/_git/<repo>
cd <repo>./mvnw clean packageFROM openjdk:17-jdk-alpine
VOLUME /tmp
COPY target/demo-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT ["java","-jar","/app.jar"]az acr create --resource-group <ResourceGroup> --name <ACRName> --sku BasicACI will be created automatically via pipeline.
- Packages JAR with Maven
- Builds and pushes Docker image to ACR
- Deploys image to Azure Container Instance
- Exposes the app via a public DNS
Don't forget to create a Service Connection to Azure in DevOps.
Set these as pipeline variables or secret variables group:
ACR_USERNAMEACR_PASSWORD
Once deployed, access it via:
http://<dns-name>.<region>.azurecontainer.io:8080/
Expected Output:
Hello, Azure!
You can add this after deployment in pipeline:
- script: |
curl http://<your-container-dns>:8080/actuator/health
displayName: 'Health Check'- View logs in Azure Portal → Container Instances → Logs
- Use Application Insights for advanced monitoring (optional)
This project is licensed under the MIT License. Feel free to use and modify.
Thanks to Microsoft Azure & Azure DevOps for providing free-tier cloud and CI/CD tools.