Implement DevOps in 7 steps using VSTS and Azure

Written by: Promove Soluções

When: July 26, 2017

Implement DevOps in 7 steps using VSTS and Azure

The desire for process automation is quite old. Many companies dream of the day when the entire systems development and support cycle is fully automated. And DevOps is a tool that makes this happen.

This dream is already a reality for many companies around the world.

The 2017 report on DevOps adoption published by Puppet and DORA shows that, in the last year, there was a 27% growth in the use of DevOps in teams worldwide.

We believe that DevOps is no longer a trend but a factor in companies' competitiveness.

However, despite the growth in DevOps, many companies still struggle to shift from their traditional development approach to a more agile approach with automated processes.

We can cite some barriers encountered in the adoption of DevOps:

  • Company culture.
  • Automation testing challenges.
  • Legacy systems.
  • Application complexity.
  • Budget constraints.
  • Difficulty managing multiple environments.
  • Limited IT skills.
  • Budgetary limitations.
  • Toolchain growth.
  • Lack of support from senior management.

In this post, we present 7 steps to help you overcome these barriers and implement a DevOps infrastructure in practice using Microsoft's Visual Studio Team Service (VSTS):

  1. Define the supporting infrastructure components based on VSTS
  2. Define the project solution using the infrastructure integrated with the code repository
  3. Set automatic build in the automatic deployment tool
  4. Create scripts to run automated unit tests
  5. Create scripts for migrating code between environments
  6. Automatically update the database structure in each environment
  7. Instantiate system application performance management software

What is DevOps?

Before detailing each of the steps for implementing DevOps infrastructure, let's explain what DevOps means in practice.

The concept emerged when John Allspaw and Paul Hammond introduced the terms Dev & Ops in their famous 2009 talk.

Then, a great movement began, led by Patrick Debois, who organized the first event focused on DevOps in 2009, called DevOpsDays.

In the following years, the event gained international recognition and has been held regularly in various cities around the world. In Brazil, the last DevOpsDays took place in November 2016 in Brasília/DF.

DevOps is a culture centered on 4 axes that can be summarized by the acronym CAMS:

  • Culture
    • Collaboration
    • End of divisions
    • Healthy relationship between areas
    • Behavior change
  • Automation
    • Deploy
    • Control
    • Monitoring
    • Configuration management
    • Orchestration
  • Metric (Evaluation)
    • Metrics
    • Measurements
    • Performance
    • Logs and integration
  • Sharing
    • Feedback is everything
    • Good communication between the team

We see, then, that automation is just one of the axes of DevOps.

The other axes are also very important for transforming the way teams develop and deliver software to their customers.

The Culture axis addresses issues related to how teams are structured and interact. The Evaluation (Metrics) axis addresses practices related to monitoring application performance.

And the Sharing axis seeks to facilitate communication between teams.

In the next sections, I will use an example project to detail the 7 steps to implement a DevOps infrastructure with a focus on the Automation and Evaluation (Metric) axes.

Step 1: Use Visual Studio Team Services (VSTS) as the supporting infrastructure

Visual Studio Team Services (VSTS) is a cloud-based platform for supporting Application Lifecycle Management (ALM) for managing applications, source code, quality, automatic deployment, and other functions.

Our example project architecture was built using VSTS, but it could just as easily have used on-premises TFS.

Organizations often choose TFS on-premises when they need their data to stay within their network, or they want to access SharePoint sites and SQL Server reporting services that integrate with TFS data and tools.

See here a comparative analysis of VSTS and TFS.

The .Net architecture is based on several components that, when integrated, provide significant gains in quality and productivity for agile development teams and deliver value to the customer.

.Net architecture can be structured in a variety of ways. Other structuring approaches will be the subject of future posts, which I'll publish soon.

The architecture we used for the example project is shown in Figure 1.

 

 

Figure 1 - Example project architecture with Visual Studio 2017, Visual Studio Team Services, Release Server Management, Git, and Azure

Figure 1 – Example project architecture with Visual Studio 2017, Visual Studio Team Services, Release Server Management, Git, and Azure

The main components of the example project architecture are as follows:

  • Visual Studio 2017 – Development environment for web, mobile, and C# applications.
  • Git – An open-source distributed configuration management tool fully integrated with VSTS.
  • Build & continuous integration – Code compilation tool.
  • Release Management (RM) – A tool for migrating code and executing deployment tasks between the staging and production environments instantiated for the example project.
  • Microsoft Azure – This is the cloud service offered by Microsoft.
  • QA – A staging environment in Azure instantiated for the sample project.
  • Prod – A production environment in Azure instantiated for the sample project.
  • Application Insights – A performance management tool for applications installed on Azure that receives information about the performance of web applications.

Step 2: Define the project solution in MS Visual Studio 2017 integrated with Git code repository

The Contact Manager project, implemented in C# using MVC and accessing a SQL Server database, was used as a template for the example project.

A Git repository was created in VSTS itself to store the source code and manage the tasks of the example project.

Figure 2 shows the Git repository screen of the example project.

Figure 2 - Git repository created in VSTS created to store the Contact Manager project

Figure 2 – Git repository created in VSTS to store the Contact Manager project

Step 3: Run the VSTS Integrated Build

The Build module belongs to VSTS, where the continuous integration concept is implemented with each check-in/commit performed on the code by the developer, as shown in Figure 3.

The Build architecture will be explained in more detail in a future post. Stay tuned!

Figure 3 - Build definition associated with the sample project's code repository

Figure 3 – Build definition associated with the sample project code repository

In general, with each check in/commit made to the code, a sequence of associated Build tasks are automatically executed.

Figure 4 shows the configuration screen for these Build tasks in the example project.

Figure 4 - List of Tasks defined for the Build of the example project

Figure 4 – List of Tasks defined for the Build of the example project

The Build tasks for the example project are as follows:

  • Task GetSources – Retrieves the sample project code from Git to the VSTS Build server.
  • NuGet restore task – Retrieves all references to installed projects in the NuGet repository.
  • Build solution – Compiles all the code associated with the example project, generating the associated DLLs.
  • Task Test Assemblies – Executes all unit test projects associated with the example project that have the string “test” in their name. TDD is executed in this task.
  • Copy File to: – Copies the generated DLLs to an intermediate area known as the artifact stage. Typically used for web projects.
  • Copy and Publish Artifact: webdeploypackage – Copies the file from the artifact stage area to create an artifact defined on the VSTS Build server with the name webdeploypackage. This task is necessary for migrating compiled code in both staging and production environments.

Step 4: Running the Automated Unit Tests

The first step to introducing quality into the development process is to automate unit tests.

Automating unit tests is a prerequisite for automating other levels of testing, such as functional testing with Selenium, performance testing with JMeter, and user acceptance testing with SpecFlow.

In the next posts, we'll discuss how to implement each of these automations. Stay tuned!

After the Build process is complete, automated unit tests, also known as Test Driven Development (TDD), should be executed, as shown in Figure 5.

Figure 5 - Running automated unit tests.

Figure 5 – Running automated unit tests.

We use MSTest for automated unit testing, a standard framework for test automation from Microsoft.

If NUnit were used, the task would be defined in the same way, since there is full compatibility with the VSTS Build.

VSTS generates a specific section to present metrics regarding the execution of unit tests, as shown in figure 6.

 

Figure 6 - Report obtained by running unit tests - Part 1

Figure 6 – Report obtained by running unit tests – Part 1

 

The following metrics are presented as a result of running tests in the VSTS Build:

  • Total number of unit test cases executed (Total Tests)
  • Total number of unit test cases that were successfully executed (Passed)
  • Total number of failed unit test cases (Failed)
  • Total number of test cases that were never executed and failed (New)
  • Total number of existing test cases that failed (Existing)
  • Percentage of test cases executed successfully (Pass percentage)
  • Unit test case execution time (Run duration)
  • Number of failures considering the last 10 tests performed (Test failures)
  • Duration of the last 10 tests (Test duration)

Once all automated unit tests have been successfully executed in the development environment, a release is generated in the staging environment for functional tests to be executed.

After successfully executing the functional tests, our application is ready to go Live in the production environment!

Step 5: Migrating the code between the staging environment and the production environment

Figure 7 shows the 3 integrated environments that are part of the example project's infrastructure architecture: Development Environment (DSV), Staging Environment (QA) and Production Environment (PROD).

Figure 7 – Code migration between environments of the Contact Manager example project.

The Development Environment (DSV) consists of the hardware and software resources used by the developer (personal notebook, Visual Studio, local IIS, local SQL Express, etc.).

In the Build Environment, the code in the trunk is compiled and automated unit tests are run.

The Staging Environment (QA) is where functional and user acceptance tests will be automatically executed.

And the Production Environment (PROD) provides external access to the system.

Figures 8 and 9 show the definition of the task group for deploying the application to the Staging and Production Environments.

Figure 8 – Migrating the code to the Staging Environment

 

 

Figure 9 – Migrating the code to the Production Environment

The tasks for deploying the application to the Staging and Production Environments are as follows:

  • Tokenizer: Transform Source filename – Modifies the SetParameters.xml file with the Connection String variables and the application URL name defined for each environment. Allows the generation of the web.config file with these new parameters. The extension is available in VSTS Marketplace.
  • Azure App Service Deploy – Executes the installation of the web application in the App Service container defined in Azure. This task is native to VSTS.
  • Task Group: Deploy migration – Task group created for reusing migration steps for both staging and production environments.

Step 6: Automatically updating the database structure in each environment

In this example project, we use the Entity Framework persistence framework. We adopt a code-first strategy, considering the creation of class attributes before generating tables in the database.

In our example, we added new fields to a model class.

Based on the CodeFirst strategy, we create the fields in the model class and generate the migration file that will be used for the migration.

Another possible strategy is DatabaseFirst, which involves generating the database first, followed by the automatic creation of domain classes.

For each environment, the following tasks were generated:

Step 7: Using Application Insight to Monitor Application Performance

But DevOps infrastructure doesn't end when the application goes into production.

The value chain of the development project with DevOps continues during the operation of the product.

This is one of the major differences between DevOps culture and traditional development methods: the team is continually responsible for the quality of the software delivered to the end user.

Therefore, it is the DevOps team's responsibility to monitor application performance, identify and analyze improvements to keep applications fully operational quickly and stably.

A study by Aberdeen indicated that application monitoring is capable of anticipating 53% of application problems before a complaint is received.

Additionally, the time to fix performance issues can improve by 48% and the total number of user complaints can be reduced by up to 15%.

Figure 10 shows the Azure Control Panel for monitoring our sample project application.

Figure 10 – Screen for diagnosing and resolving issues when monitoring Azure applications

The first panel describes the % availability of the sample project's App Service container.

The second panel lists all application outages in the last 24 hours. Application Insights offers hundreds of application monitoring metrics, which will be covered in a separate post.

What are the benefits of DevOps?

The 2017 report on the state of DevOps worldwide presents data on the benefits achieved by companies in increasing the performance of their IT teams.

This study found that high-performing IT teams perform better as follows:

  • Code deployments 46 times more frequent.
  • 440x faster commit-to-deploy time.
  • 96x faster average time to recover from downtime.
  • 5x lower change failure rate (changes with a 20% chance of failing).

Furthermore, the study also identified that high-performing organizations spend 21 percent less time on unplanned work and rework, and 44 percent more time on new work.

In our experience, we've found that a DevOps culture helps reduce dependence on people, as well as eliminate the need for complex manuals to perform infrastructure tasks such as migration, version updates, and others.

Team motivation also increased with the implementation of DevOps in our projects, eliminating manual and repetitive tasks.

The increased speed of delivery of new features also helped to increase user satisfaction with the applications.

Although DevOps brings many benefits, implementing a DevOps culture requires a great deal of dedication from the development and infrastructure team.

The success of a DevOps initiative in an organization depends on good project planning with prioritization of actions focused on clear and tangible goals.

So, did you get a good understanding of this methodology? Get in touch to find out how ProMove can help your company implement a DevOps culture.

Promove Soluções

Promove is recognized for having leading consultants in Brazil and worldwide. We offer specialized consulting services for software companies, focusing on implementing an agile culture, compliance with ISO and LGPD standards, and CMMI and MPS quality models.

Comments

Your email address will not be published. Required fields are marked with *.

Be the first to comment!


Similar Articles

High maturity of CMMI: how statistical process control brings real predictability to software projects
Governance and Processes
October 28, 2026

High maturity of CMMI: how statistical process control brings real predictability to software projects

Statistical process control is the set of techniques that measures how a process behaves over time, separating fluctuations...

Read article
CMMI AIM: the framework for maturity in artificial intelligence.
Artificial Intelligence
July 16, 2026

CMMI AIM: the framework for maturity in artificial intelligence.

CMMI AIM (Artificial Intelligence Maturity) is the framework for...

Read article
The iFood data breach exposed the data of over one million users. The vulnerability that allowed this is more common than it seems.
Information Security
June 19, 2026

The iFood data breach exposed the data of over one million users. The vulnerability that allowed this is more common than it seems.

The iFood data breach took months to become public. The incident occurred in December 2025. Confirmation only came in June 2026, after...
Read article