In this exercise we shall build Continuous Integration and Continuous Delivery pipeline with VSTS and deploy sample Go App to Azure Web App through Azure DevOps Project
Azure account – https://portal.azure.com
Continuous Integration: Integrate early and often – Jez Humble
Steps to build CI/CD for sample app
- Login to https://portal.azure.com
- Search for DevOps Project and select DevOps Project resource. Click on Create to create new DevOps Project
- Select your preferred language, Azure support multiple languages like Go, .Net Core, Node.js, Python, PHP, Java, Static Website. For this Demo lets Select Go and click on Next
- Choose Go application framework. select Simple Go app and hit Next
- Select Azure service to Deploy either Containers and Web App. For this Demo we will Web App for Containers. The sample app is containerised with Docker. We will take at the code in the next steps.
- Its time to create Microsoft VSTS account for CI/CD pipeline. If you already have VSTS account then select use existing account, otherwise select Create New
- If you don’t have VSTS account then select Create new, enter Project Name as FirstGoProject and click Done
- If you already have VSTS account then select existing account, enter Project Name as FirstGoProject and click Done
- It will take 1 or 2 minutes to create the Resources, Click on the Notifications to see the status. Once deployment is complete open the resource. Azure has done lot of things for us in the background. It has uploaded sample code into Git, created CI build and Release Definition in VSTS and deployed Go app to Azure web app. Navigate the each of the to see the pipeline and deployed application.
- Sample application is deployed successfully
- Lets dig into Build pipeline, click on the Repository Code button from DevOps project resource we have created. This will take you to VSTS. VSTS is an Microsoft platform to manage work, build and manage CI/CD pipeline. In this below slide we can see the sample Go App code is being uploaded to Git in VSTS
- Click on Build and Release tab to look into Build & Release Pipeline. Here you can see out last build was success, which was initiated by Azure DevOps Project resource. Now click on Build Definition i.e FirstGoProject – CI. Select Edit to see the Build definition steps.
- Here we can see VSTS had added 2 steps One to Build an Image of our sample Go containerised application and other to Push an Image to Azure Registry.
- Lets look into our Release Pipeline, Green box shows the status of the recent release. Click Releases tab and select Release Defintion. Green box with check marks shows the status of our release. In this exercise Azure DevOps Project has run this first release.
- In this view we can configure Deployment to Cloud/On-prem Servers. You can click on Add to configure QA, Stg, Prd environments through which you can deploy to Azure, AWS or even other cloud providers. Select 1 phase, 1 task to see the Deployment tasks.
- Release has just one task to deploy to Azure. This task picks App image from Azure registry and deploys to Azure Web App
We have successfully create CI/CD pipeline and Deployed sample app to Azure.
VSTS gives lot of flexibility and extend-ability. please check out VSTS documentation.