A CI/CD pipeline in Azure DevOps automatically builds, tests and deploys your application every time a developer pushes code. To set one up for an Angular app, create an Azure DevOps organization and project, add a new pipeline, install Node.js and Angular CLI, run npm install and the build, copy the output to your server over SSH, and enable the CI trigger.
CI (Continuous Integration) starts automatically whenever code is pushed to your Azure Repos repository: the pipeline compiles the code and runs the checks. Once that build succeeds, the CD (Continuous Deployment) part delivers the output to your staging or production server. In this tutorial we create an Azure DevOps pipeline for an Angular application from scratch.
Step 1: Sign in to Azure DevOps
Open dev.azure.com and sign in with your Microsoft account.
Step 2: Create an Azure DevOps organization
Create a new organization. Choose a unique name, since it becomes part of your project URL.
Step 3: Create a new Azure DevOps project
Enter a project name, set the visibility to Public or Private, and click the Create button.
Step 4: Open Pipelines and create a new pipeline
Go to the Pipelines section in the left menu and click to create a new pipeline.
Step 5: Select your source code repository
Choose the repository that holds your Angular source code.
Step 6: Start with an Empty job
Select the Empty job template so you can add the tasks yourself.
Step 7: Add the Angular build tasks
Because this pipeline builds an Angular application, add the following tasks to the agent job:
- Task 1: Install the latest Node.js version
- Task 2: Install Angular CLI
- Task 3: Run npm install to fetch dependencies
- Task 4: Build the Angular source code
- Task 5: Copy the build files to the server over SSH
Now click Save & queue to run the pipeline, then check the build job status on the run summary page.
Step 8: Enable Continuous Integration
Turn on the CI trigger so every push to the branch starts a build automatically.
Why use Azure DevOps for CI/CD?
- Automated builds catch errors early
- Every release follows the same repeatable process
- Deployments become faster and less risky
- Azure Pipelines works with Azure Repos, GitHub and many other tools, so you can ship Angular, .NET, Node.js and other applications
Conclusion
You now have a working Azure DevOps CI/CD pipeline for an Angular app: from code push to automated build and SSH deployment. Extend it with unit test tasks, approval gates and separate dev, staging and production stages as your project grows.
Frequently asked questions
What does CI/CD mean in Azure DevOps?
CI builds and tests code on every commit, while CD automatically releases the successful build to your target environment.
Is Azure DevOps free?
Yes, Azure DevOps offers a free tier with limited parallel jobs for individuals and small teams.
Can I deploy an Angular app with Azure Pipelines?
Yes. Install Node.js and Angular CLI, run npm install and the build, then publish or copy the dist output to your server.