Forum Discussion
How to deploy Angular + Java Springboot into Azure app service using Azure Release Pipeline ?
Hi everyone. Good morning/evening.
We are working on developing a new POC application & need some help with the Azure CI/CD pipeline. Our application is based on frontend as angular & backend as java springboot. We were able to run the build pipeline successfully and publish the artifacts to JFrog artifactory. However, the next challenge we have is how to deploy it to an Azure App Service.
Our frontend is running on Angular 16 and backend is java springboot. We have 2 separate artifacts, frontend is generating a dist folder wrapped with tar.gz file & backend is generating a jar file. How can we deploy this together into an Azure App Service using azure devops release pipeline?
- Matthias-BraunBrass ContributorI have already set up pipelines, including for Azure App Services. Unfortunately, I have no knowledge of JFrog and I also lack information on which platform (Azure DevOps, GitHub) the pipeline should be built on.
However, I have found a very comprehensive article on the subject that I think may help you: https://dev.to/azure/using-azure-pipelines-to-build-test-and-deploy-a-spring-boot-and-angular-application-3-7-593j - DTBIron Contributor
Hi anupam2706,
Deploying an Angular frontend and a Java Spring Boot backend to Azure App Service using Azure DevOps Release Pipeline involves a few steps. Here's a structured guide to help you achieve this:
Step-by-Step Guide to Deploy Angular + Java Spring Boot to Azure App Service
Prerequisites
- Azure DevOps Account: Ensure you have an Azure DevOps account.
- Azure App Service: Create two Azure App Service instances, one for the Angular frontend and one for the Java Spring Boot backend.
- JFrog Artifactory: Ensure artifacts are correctly published to JFrog.
Step 1: Set Up Release Pipeline in Azure DevOps
1.1. Create a New Release Pipeline
- Go to your Azure DevOps project.
- Navigate to Pipelines > Releases.
- Click on New pipeline.
1.2. Add Artifacts
- Click Add an artifact.
- Select JFrog Artifactory as the source type.
- Choose the repository where your Angular and Spring Boot artifacts are stored.
- Repeat this step to add both frontend (dist folder) and backend (jar file) artifacts.
1.3. Define Stages
- Click on Add a stage and choose the Empty job template.
- Name the stage (e.g., "Deploy Angular Frontend").
- Add another stage for the backend deployment (e.g., "Deploy Spring Boot Backend").
Step 2: Deploy Angular Frontend
2.1. Add Deployment Task for Angular
In the "Deploy Angular Frontend" stage, click on Tasks.
Add a new task by clicking on the + button.
Search for Extract files and add the task to extract the tar.gz file.
- Archive file patterns: $(System.DefaultWorkingDirectory)/**/*.tar.gz
- Destination folder: $(System.DefaultWorkingDirectory)/frontend
Add an Azure App Service Deploy task.
- Azure subscription: Select your subscription.
- App type: Web App on Linux.
- App name: Your frontend App Service name.
- Package or folder: $(System.DefaultWorkingDirectory)/frontend
Step 3: Deploy Java Spring Boot Backend
3.1. Add Deployment Task for Spring Boot
- In the "Deploy Spring Boot Backend" stage, click on Tasks.
- Add an Azure App Service Deploy task.
- Azure subscription: Select your subscription.
- App type: Web App.
- App name: Your backend App Service name.
- Package or folder: $(System.DefaultWorkingDirectory)/**/*.jar
Step 4: Configure and Trigger the Release
4.1. Save and Create Release
- Click Save to save the release pipeline.
- Click Create release to start the deployment process.
- Monitor the release pipeline for any errors and ensure both the frontend and backend are deployed successfully.
Additional Resources
- Official Documentation: Deploy a Java Spring Boot app to Azure
- Comprehensive Guide: Using Azure Pipelines to Build, Test, and Deploy a Spring Boot and Angular Application
Conclusion
By following these steps, you should be able to deploy your Angular frontend and Java Spring Boot backend to Azure App Service using Azure DevOps Release Pipeline. If you encounter any issues or have further questions, feel free to ask.