Reader small image

You're reading from  Implementing DevOps with Microsoft Azure

Product typeBook
Published inApr 2017
Reading LevelIntermediate
PublisherPackt
ISBN-139781787127029
Edition1st Edition
Languages
Tools
Concepts
Right arrow
Author (1)
Mitesh Soni
Mitesh Soni
author image
Mitesh Soni

Mitesh Soni has 8 years of experience in managing software for GNU/Linux and other UNIX-like operating systems in production environment. He started working as a professional with DevOps from 2013 and has worked on several live projects related to DevOps. https://www.linkedin.com/in/alessiogarofalo
Read more about Mitesh Soni

Right arrow

Chapter 6. Continuous Delivery to Azure Web Apps and ASE Using VSTS

It's fine to celebrate success but it is more important to heed the lessons of failure.                                                                                                                –Bill Gates

This chapter will present how to deploy an application in Azure Web Apps and ASEs using VSTS. It also includes the security and governance aspects while deploying in different environments to ensure that only authorized persons can perform the deployment operation, and the process has to be verified.

This chapter will cover end-to-end automation visualization for deploying an application in the PaaS offering of Microsoft Azure.

  • Overview of CD and continuous deployment
  • Configuration of Microsoft Azure subscription
  • Build and release automation
  • Environment with release tasks
  • Security and governance with approver setup
  • End-to-end automation process execution
  • Continuous feedback on release execution

Overview of CD and continuous deployment


CD and continuous deployment are normally used interchangeably. However, there is a minor difference. 

CD is the application deployment into an environment that is not production, so it can be development, QA, stage, pre-production, and so on. 

Continuous deployment is the application deployment into the production environment. 

We need to understand the way an application is deployed in production and non-production environments manually and then try to automate that process. The automated approach of application deployment doesn't change. It is all about the location where the application is getting deployed.

CD makes the application package production ready. Continuous deployment goes through end-to-end automation for release management and manual intervention is not required.

A minor difference is the manual approval process in the environment that makes CD and continuous deployment different from each other. In the case of a production environment...

Configuration of Microsoft Azure subscription


We will first go to our VSTS account. Here, we need the following things to be accomplished:

  • Configure our Microsoft Azure subscription so we can connect to Azure Web Apps from VSTS
  • Create a release definition that achieves the task of application deployment in Azure Web Apps

In the Recent section, click on PetClinic:

It will open the Dashboards page for the project created in VSTS:

In the top bar, click on Build & Release, which will open a menu. Click on the Releases menu item:

Click on the Releases link on the page. 

As this is a new account, there is no release definition, so this section is empty. We can create a new release definition so that we can automate application deployment into Azure App Service or ASEs.

The way we have build definitions for continuous integration, we have release definitions for continuous release, CD, or continuous deployment. Release definitions contain different tasks that can be used for application deployment...

Build and release automation


Our main idea is to automate end-to-end activities that play a role in application life cycle management. To be precise, we want to have a scenario where the following activities are automatically executed with some workflow or approvals once developers commit some code for feature development or bug fixes:

  • Continuous integration:
    • Compilation of source files
    • Execution of unit tests
    • Static code analysis
  • CD:
    • Workflow-based application deployment into different environments, where one or more approvals are needed to deploy in a specific environment
  • Continuous testing:
    • Load testing with VSTS or Apache JMeter

We have already configured Azure subscription. Once it is completed successfully, we can select App Service Name. Click on the down arrow, and Azure Web Apps available in the configured Azure subscription will be available in the list. 

Note

It is important to note that the list in App Service Name can have Azure Web Apps hosted in ASE or non-ASE. In simple terms, it doesn...

Environment with release tasks


We have configured automated deployment in the production environment. What if I need to deploy into multiple environments?

Let's remember how we are managing different environments in Azure Web Apps. 

Any guesses? 

Yes, you are right! 

Deployment slots. We use deployment slots for different environments. So we should create multiple environments in the release definition and perform the deployment.

So, the next question should be, how do we create an environment that we can use for package deployment in a specific deployment slot in Azure Web Apps?

In the release definition, click on +Add environment and select Create new environment. We can select Clone selected environment if we want to have the same tasks as the existing environment in the new environment:

In the new environment, let's keep pre-deployment approval automatic.

Select Trigger to deploy automatically whenever a deployment to the previous environment is successful. We can rearrange or rename it once...

Summary


We are at the end of another milestone, and that is CD or continuous deployment of an application package into Azure Web Apps that can be hosted in ASE or non-ASE:

We covered the following things in detail:

  • Creating a release definition to deploy a WAR file, an artifact, or an application package to Azure App Service
  • Triggering a release definition execution based on successful build definition execution in VSTS
  • Deploying a WAR file, an artifact, or an application package to Azure Web Apps deployment slots
  • Converting a WAR file into a ZIP file using the Trackyon Advantage task so it can be distributed in the Azure Web Apps
  • Creating or cloning multiple environments in the release definition to deploy Azure Web Apps to deployment slots
  • Creating approval-based workflow for release management so the deployment process will start only after approval from designated stakeholders

So far so good.

We covered in detail the basic concepts related to DevOps, Eclipse, and TFS integration for a code repository...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Implementing DevOps with Microsoft Azure
Published in: Apr 2017Publisher: PacktISBN-13: 9781787127029
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime

Author (1)

author image
Mitesh Soni

Mitesh Soni has 8 years of experience in managing software for GNU/Linux and other UNIX-like operating systems in production environment. He started working as a professional with DevOps from 2013 and has worked on several live projects related to DevOps. https://www.linkedin.com/in/alessiogarofalo
Read more about Mitesh Soni