Click here to Skip to main content
14,176,439 members
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

6K views
5 bookmarked
Posted 18 Apr 2018
Licenced CPOL

Step by Step Process to Deploy Web Application to Azure with VSTS-CI/CD Pipeline

, 18 Apr 2018
Rate this:
Please Sign up or sign in to vote.
Step by step process to deploy web application to Azure with VSTS-CI/CD pipeline

Introduction

This article is about publishing ASP.NET MVC application to Azure or on premise server using CI/CD pipelines in the Visual Studio team services.

Background

The user should have some knowledge about the application deployment process onto server or to cloud.

Prerequisite

User should have an account in Visual Studio team services. If you have any of the MSDN or Visual Studio subscriptions, you can use VSTS.

User should have an account in Azure for deploying and creating application on the cloud side.

If you already have code set up in VSTS, you can skip to step 4.

Step 1: Create VSTS Project

In VSTS, create a project under your account.

You can select the Source control version as GIT or TFS. I selected Git because TFS creates problems with branching which is used in Azure for deployment in later stages. You can define which branch has to be deployed to the Azure and which is required field.

Step 2

Clone the branch that is created by VSTS to your local repository. You can use the option "Clone in Visual Studio" that makes it simpler to MAP and create your local branch.

You will get a message that the clone was successful. Create a new MVC Web project into that clone from the Team services itself. This would save you time to move and copy the project from other folders.

Step 3: Push the Branch to VSTS

Create a local branch for your local copy and push everything to VSTS.

Once you push it, you will see it in the VSTS.

Step 4: Create Build in VSTS

Click on the set up build.

You will get prepopulated dropdowns. You can change the settings here with the branch for different build.

Select a Template

You can select any template based on your application. I have chosen ASP.NET.

You can use any build option based on the requirement. I have selected Build Solution. You can find more information here.

Hit the save and Queue button. A pop up appears with to save build definition. You have to select the agent queue in this. Agent is compiler from VSTS that builds your application for VSTS. You can select many options and OS. I have selected Hosted VS2017. You can also set up various other properties like the Build Configuration and Platform, etc. or your own parameter by clicking on the add button.

Hit the save and queue again.

You can see the build in progress under the build definitions.

Step 5: Create Release Definition

Click on the release tab under the Build and Release. Create new definition.

Select a template. I am choosing Azure App service Deployment since I would be hosting it on the Azure Cloud.

Give the environment the name as Test or according to your situation.

Create an artifact from the build definition that we created.

Set Continuous Build Trigger

Trigger is used to tell VSTS when to start the deployment.

You can also schedule the trigger by time.

Pre Deployment Conditions

You can add conditions for deployment. You can have multiple environments and so you can set condition on previous environments successful deployment and test. For example, deploy to production only when the app is successfully deployed to test.

Step 6: Create CD Pipeline in Azure

Create Azure app service in Azure.

Click on the service and select Continuous Delivery from the options.

Configure the CD service.

Select the appropriate options that you created in the VSTS. Most of the options would be pre populated.

Configure CD to ASP.NET or according to your scenario.

If you want to set up load test, you can use this option to set up load test.

Click OK and Azure will set up your continuous delivery. The application would be deployed.

Test your application on the web.

You can also see the updates in VSTS about the release and status.

I hope this article would be helpful. Let me know if there is a chance for improvement of this article and I will try to make the changes.

Thanks for reading!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

John Kuriakose
United States United States
No Biography provided

You may also be interested in...

Pro
Pro

Comments and Discussions

 
QuestionScreenshots and images? Pin
Klaus Luedenscheidt18-Apr-18 18:33
memberKlaus Luedenscheidt18-Apr-18 18:33 
AnswerRe: Screenshots and images? Pin
John Kuriakose19-Apr-18 5:38
memberJohn Kuriakose19-Apr-18 5:38 
GeneralRe: Screenshots and images? Pin
Klaus Luedenscheidt22-Apr-18 19:03
memberKlaus Luedenscheidt22-Apr-18 19:03 
GeneralRe: Screenshots and images? Pin
Klaus Luedenscheidt22-Apr-18 19:04
memberKlaus Luedenscheidt22-Apr-18 19:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04 | 2.8.190525.1 | Last Updated 18 Apr 2018
Article Copyright 2018 by John Kuriakose
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid