未加星标

DevOps overview with Microsoft Azure

字体大小 | |
[系统(windows) 所属分类 系统(windows) | 发布者 店小二04 | 时间 2019 | 作者 红领巾 ] 0人收藏点击收藏

This post outlines the steps that you can follow to implement DevOps in Azure pipeline. The steps includes setting up an application, creating continuous integration, continuous delivery and release pipelines in Azure environment.

What is DevOps?

DevOps is the union of people, process, and tools to enable continuous delivery of value to our end users.

Most people feel that DevOps is just operations where developers push software into servers. It’s really more than development, its whole life-cycle of your application from back-log prioritization to development to delivery of the product to customers and monitoring in actionable feedback to enhance your product.


DevOps overview with Microsoft Azure

Image Source: Microsoft

Step 1: Setting up an application in AZURE with version control

Visit https://dev.azure.com , sign in with Microsoft account. Create a project as follows


DevOps overview with Microsoft Azure
DevOps overview with Microsoft Azure

DevOps does not work very well without setting-up a version control. This can TFVC (team foundation version control) or GitHub integrated in TFS. Connect to the created project from visual studio as follows, version control in this case is GitHub.


DevOps overview with Microsoft Azure

After cloning repository to local, add your source code to it Git. Let’s create two branches master and dev branches.


DevOps overview with Microsoft Azure

First commit your source code from your local repository to master and then create dev branch from master


DevOps overview with Microsoft Azure

Master branch is the one we take code from for release but developers wouldn’t work on this branch. If it’s single person working on project then choose Commit All and Push otherwise Choose Commit All and Sync.

Now create a develop branch by clicking branches in team explorer, you notice the master branch there, right-click on master and say new local branch from and name develop as follows


DevOps overview with Microsoft Azure
DevOps overview with Microsoft Azure

You have to publish the branch to make it available for use by right click on develop and say publish branch. Both master and develop branches are identical, you can start working on develop branch.


DevOps overview with Microsoft Azure

Step 2: Create a Continuous Integration (CI) build pipeline

Purpose of creating CI integration build is to run clean automated builds quickly especially when multiple developers integrating their code to shared repository. This also helps in finding the defects early.

Login into VSTS (Visual Studio Team Services) https://dev.azure.com/planetops/demoapps use your respective project URL.

From VSTS home screen click pipelines and click Builds


DevOps overview with Microsoft Azure

Create a new build pipe line by clicking new pipeline button, select the location of code in this case choose Azure Repos


DevOps overview with Microsoft Azure

After selecting the repository path it will prompt you to select the template that suites your project. Notice it is not strictly Microsoft, you will find various templates like Maven for java, Android, Xcode etc. In this case we choose ASP.NET CORE template.


DevOps overview with Microsoft Azure

Give a name to build and say commit the build to development branch and run.


DevOps overview with Microsoft Azure

You can also edit the build definition in visual designer


DevOps overview with Microsoft Azure

You can override the default configuration in visual designer. Example : when lot of team members updating code often and you want to reduce the number of builds that are running then check batch changes check box. When you check this box system waits until the build is completed.


DevOps overview with Microsoft Azure

You can additional steps during the continuous integration build like restoring nugget packages, running batch scripts, copying files and running some unit test cases. You can do this by selecting ASP.NET core template.


DevOps overview with Microsoft Azure

Step 3: Create a Continuous Delivery (CD) build pipeline

Purpose of creating Continuous Delivery pipeline is to transfer all development changes to production ready build in a risk free and quick manner. The goal is ability to deliver the higher quality product to customers with automated builds.

Initially it may take some time to setup pipe-lines in your builds and get everything work correctly, you don’t have to spend this time and money every time you deploy your software manually to servers. Thanks to tolls that make your life easy!

Create a build definition like in step2 for master branch. Idea is to kick this build soon the code merged into master branch.

How the code get merged into master branch? Developers create pull requests for review which in turn get into master branch.

Create a new pull request by navigating to VSTS (VisualStudioTeamService) home screen and click pull requests under repos. You can do this from Visual Studio team explorer too


DevOps overview with Microsoft Azure

The idea of creating a new pull request is to transfer develop branch changes to master.


DevOps overview with Microsoft Azure

While creating new pull request, you can add all commit changes and add reviewer for the approval. Once pull request has been created, you can approve and complete.

Step 4: Create a Release pipeline

Purpose of creating release pipeline is to deploy changes from master branch (CD build) to various environments (stages) like dev, QA and production

Create a new release pipeline from by clicking releases in VSTS home screen.


DevOps overview with Microsoft Azure

Click on build and select CD build that you created in Step 3. Next click on Add stage box name the stage Dev and add Azure App Service deployment tasks to it


DevOps overview with Microsoft Azure

You need provide your subscription details to deploy it to AZURE. You can add other tasks like running some tests after deploying to azure. You can also include tasks like run some database restore in dev environment and run some cloud based load testing.

The tasks inside dev stage appear as follows


DevOps overview with Microsoft Azure

You can add post-deployment conditions to pipeline, example: adding approvers to authorize the deployment


DevOps overview with Microsoft Azure
DevOps overview with Microsoft Azure
Based on the dev stage environment, you can clone QA, Pr

本文系统(windows)相关术语:三级网络技术 计算机三级网络技术 网络技术基础 计算机网络技术

代码区博客精选文章
分页:12
转载请注明
本文标题:DevOps overview with Microsoft Azure
本站链接:https://www.codesec.net/view/628339.html


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(windows) | 评论(0) | 阅读(102)