An Introduction to Microsoft Azure DevOps

An Introduction to Microsoft Azure DevOps

Introduction

In this article I will give you an introduction to DevOps and how to use Microsoft Azure DevOps to build, test and release your software.

I will use an Android app written in Kotlin as the example, but most of the things I write about is applicable to other types of solutions.

We at Avalon Innovation are more than 250 specialists all over Scandinavia who are passionate about developing ground-breaking, innovative product and system solutions that really make a difference. Since 1997 we have tackled many challenging and difficult assignments, which have provided us with broad technical expertise and unique insights into innovation.

What is DevOps?

Donovan Brown is a Principal DevOps Manager at Microsoft and defines DevOps this way.

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

From a more technological standpoint, DevOps is a combination of development methods and operation methods to shorten the development lifecycle and aims to deliver software with high quality more frequently.

A DevOps tool like Microsoft Azure DevOps usually includes features like scrum/kanban boards, code repos, build and test tools (Continuous Integration) and release tools (Continuous Delivery).

Getting Started

The easiest way to get started is to go to the Azure DevOps portal (https://azure.microsoft.com/en-us/services/devops/) and start a free account. Just sign in with your Microsoft account (or create a new one) and sign up for a free Azure DevOps environment.

In a matter of minutes you will be able to start to explore Azure DevOps!

No alt text provided for this image

Boards

Azure DevOps includes all you need to manage your DevOps project and the Boards section supports both the Scrum process as well as Kanban.

No alt text provided for this image

This article will not focus on Boards, but try it out! It really has all that you need.

Repos

It will make your life a bit easier if you place your git repos in Azure DevOps, but if it's not possible to move your code at the moment, the build and release tools can integrate with other platforms like GitHub.

No alt text provided for this image

If you decide to move your code Azure DevOps has all the git features you need.

Pipelines

The build and release pipelines are what I will focus on in this article.

A build pipeline defines all tasks that are involved in building, testing and packaging your software.

A release pipeline defines the end-to-end process of deploying your software.

Builds - Continuous Integration (CI)

CI is the process of automating building and testing of code every time someone commits a change to the repo.

A build pipeline consists of tasks to be executed and what tasks we use depends on the technology used in the software.

I will now guide you on how to create a new build pipeline for an Android app that will build the code, run the tests and package the app to an artifact that can later be released.

No alt text provided for this image

Start by selecting the Builds meny and then click on New -> New build pipeline. This will start the process of creating a new build pipeline.

No alt text provided for this image

The next step is to select the code repository where the source code is. In my case it's in Azure DevOps in a repo called "KotlinMotorcycles" and I will fetch the code from the master branch. Click Continue!

No alt text provided for this image

Either we select to use the YAML language to define the build pipeline or we select a template that matches the solution.

In my case I select Android, because this is an Android app and I prefer to use the visual task configuration tool. Select and click Apply!

No alt text provided for this image

Now this is the main editing view of a build pipeline! If you select Pipeline as in the image above you can change the agent pool used to build your software. Microsoft hosts a number of build agents for you on Windows, Linux and macOS, but you can also define your own build agents on your own hardware if you like.

If you select Get sources you can change settings about your code repo and beneath that is a list of tasks that will be run when the build job is run.

Each type of task has its own set of settings that sometimes is mandatory to fill out and sometimes are optional.

Click the + button to add a new task.

No alt text provided for this image

Here you can select from a vast number of build tasks, testing tasks, packaging tasks and tools for running scripts. It even has a marketplace where you can download tasks and extend your Azure DevOps environment!

No alt text provided for this image

Click on the top menu Triggers! This is where you can turn on CI! When turned on, this build job will run every time someone commits changes to the branch you selected.

You can also schedule builds or make this build job run after another build job completes to create a chain of build jobs.

When your done select Save & queue to run your build job for the first time!

No alt text provided for this image

Now the job is running! Click on the link to follow the process.

If one of the tasks/steps fails then click on the step to read the log output and try to find out why it was failing. It could be a faulty setting or that a test failed.

After a couple of minutes the build is done.

No alt text provided for this image

Success! If I click on the gradlew build task and scroll down to the bottom I can see that the build was successful and the tests has been run.

No alt text provided for this image

This is what you want to see! Lets follow the link and view the test results.

No alt text provided for this image

All 8 tests has been run successfully! Great!

The result of a build is called an Artifact and that is your built and packaged software that is now available to be deployed when you want to. This we will look at in the next section.

Releases - Continuous Delivery (CD)

CD is the process of delivering a built and packaged artifact to the users.

The deployment destination can be your own server, a hosted app in the cloud somewhere or more or less any place. I will deploy my app to Microsoft App Center. I will cover App Center in another article, because it has a lot more great features than just distributing mobile apps.

No alt text provided for this image

Start by selecting the Releases meny and then click on New -> New release pipeline. This will start the process of creating a new release pipeline.

No alt text provided for this image

Just like when we created a build pipeline, you get to select a template to get started, but there actually aren't a template for App Center so I just select to create an empty pipeline.

No alt text provided for this image

This is the main view for a release pipeline. To the left you can select an artifact to base the release on, beneath that you can select to schedule releases and to the right you define your stages.

Stages is the tool to use to move software to different audiences. You can for example define stages for development, QA and production where every stage represents is an environment for a certain audience. The dev environment is perhaps only used for testing by your own team, QA for external testing and production for released software. Azure DevOps helps you to move an artifact between the stages in a controlled manner.

No alt text provided for this image

Click on Add an artifact. In this case we select to get the artifact from a build pipeline, select the pipeline and then click Add. There are other options on how to fetch an artifact. Please explore!

No alt text provided for this image

Click on Schedule not set. This is where you can schedule your releases! Often you want to do a nightly release to dev or QA and this is how you do that.

No alt text provided for this image

Click on 1 job, 0 task in the stage box to define the tasks involved in the stage. In my case I added a Deploy to App Center task and connected it to my App Center account.

Lets create a release! Click on the meny Release -> Create a release at the top of the screen.

No alt text provided for this image

This screen pops up where you select the stage and then click on Create.

No alt text provided for this image

The release was created! Click on the link.

No alt text provided for this image

The release has been created, but not deployed yet. Move your mouse over the stage and click on the button Deploy that will appear.

No alt text provided for this image

Click Deploy.

No alt text provided for this image

It will work for a while...

No alt text provided for this image

Success! The deployment is complete!

Conclusions

I hope you enjoyed this short introduction to Microsoft Azure DevOps! There are a lot more features to explore and I hope you got inspired to do so.

Microsoft Azure DevOps makes it easy for us to work with boards, code repos, automatic build, automatic tests and automatic deployments. It is a complete solution for DevOps teams and does the job well!

Happy Coding! :-)

DevOps is an approach to software development that enables better collaboration between the development and the operations teams. Basically, it is a methodology that aims to bridge the gap between developers and operations during software development to facilitate a more productive and efficient workflow. Sample Copy : http://bit.ly/2TKsB0Q 

Like
Reply

To view or add a comment, sign in

More articles by Jonas Frid

  • We need to stop pretending that everyone is needed at work

    We are facing a transformation greater than industrialization. Yet we still talk as if work is the only way to earn a…

    5 Comments
  • Är 2026 det sista året vi byggde UI?

    Det finns en anledning till att det här är svårt att greppa. Vi har byggt mjukvara på samma sätt i över 40 år: System…

  • Take your App to the next Step with Microsoft App Center

    Introduction In this article I will give you an introduction on how to use Microsoft App Center to manage everything…

  • Unit Testing in Android Studio with Kotlin and JUnit

    Introduction Today when working in an agile development project, the stakeholders usually wants us to deliver features…

  • Unit Testing in Xamarin with NUnit

    Introduction Today when working in an agile development project, the stakeholders usually wants us to deliver features…

  • Custom hit test in Xamarin.iOS

    Views can catch touch events, but normally that is done in a rectangle! What if you want a round image and only capture…

  • MvvmMobile! Just another MVVM framework? ;-)

    Introduction MvvmMobile is an MVVM framework specifically developed for Xamarin iOS and Xamarin Android with focus on…

  • Range Slider In Xamarin Forms

    Intro Earlier this year I found myself in need of a range slider for a Xamarin Forms project. I found a couple of…

    1 Comment
  • Bindable Grid In Xamarin Forms

    Intro Xamarin Forms is a great platform for building native cross-platform apps for iOS, Android and Windows, but…

    5 Comments

Others also viewed

Explore content categories