Simple SQL Server, .Net Core & Angular Deployment with Azure DevOps

Simple SQL Server, .Net Core & Angular Deployment with Azure DevOps

Code deployment is one of those task developers must do on day to day basis, with nowadays technologies this has gotten to a point where it can be fully automated with barely human intervention and all of it almost for free. With that being said the goal of this article is to describe how to successfully implement a Full Application deployment in Azure DevOps.

Code deployment is one of those task developers must do on day to day basis, with nowadays technologies this has gotten to a point where it can be fully automated with barely human intervention and all of it almost for free. With that being said the goal of this article is to describe how to successfully implement a Full Application deployment in Azure DevOps.

This is not a walkthrough sorry, I do prefer to explain things with a real implementation even if that means to skip a bit of the information. The idea is to get to what we really care, that is the final look of the configuration.

Tech Stack

As you might know, a web application is typically composed of 3 parts; storage, services, and the user interface, all of them interact together to serve all the application capabilities to the end-users. These are represented by the following code projects.

  1. Database (SSDT — SQL Server Data Tools)
  2. .Net Core API
  3. Angular 8

This gives us the first guideline of how to compose the deployment, we can understand this as the steps to follow to get it all working.

Pipeline

A general definition can be understood as the programmatic steps to achieve something, it does not necessarily mean to deploy code, however, in software development 99% of the time that is the real goal.

Microsoft’s definition:

Azure Pipelines is a cloud service that you can use to automatically build and test your code project and make it available to other users

Now that we have some basic understanding of a Pipeline let’s dive into what exactly are we trying to do. A deployment pipeline is very often composed of the followings:

  1. Develop. Is the assets and source code produced by the development team, it should reflect the business needs.
  2. Build. Is the process of converting source code to another form of code or deliverable that can be understood and executed by machines.
  3. Deploy. It the process from which a specific version of the software is available for use, it can be to a distributed environment with multiple nodes or to a single web server for example.

Pipeline workflow

Remember, this is a simple pipeline strategy, other approaches can include unit testing, code checks, pre-conditions, and so on.

Build & Deploy

Besides the coding activities, we have the Build & Deploy steps on our workflow, in Azure DevOps these are represented as Pipelines & Releases respectively so we will continue with these terms from now on.

The goal of this setup is to end up with 3 Pipelines per each one of the data tiers of our application database, backend, and frontend. The same will happen for the Release but we will get to them soon.

Database pipelines for db, api and web

Database Pipeline

Pipeline. Defines the name, the Agent which is where the job is going to be executed, and finally the artifact name.

Database pipeline name step

Get Sources. Where to get the code from? typically is a composition of Provider — Project — Repository-Branch,

Database pipeline get sources step

Build Solution. This is where the target project is set up so we have to indicate the explicit location on the repository branch. We can also manipulate some parameters like the build version, and the architecture x64, or x86.

Configuration (debug/release), this is important because it defines what kind of deliverable we are producing, the main difference is that the debug version is not optimized, additional information is required and generated to be able to set breakpoints in the code so developers can run programs step by step. A release version lacks all of this information and is fully optimized. That being said, the build process will even change the original code for something equivalent to the sake of better performance.

Database pipeline build step

Artifacts: This is an important concept of the build process, it is the package that encapsulates all the assets produced by a build process it contains the deliverable code and other files that can be included manually during the build process. These are formally published internally in Azure DevOps so they are available for other processes to pick up.

Database pipeline publish step

There you go, this all we need to successfully run a database build in .Net. Remember this is only the first step, it finishes when we have produced the artifacts so they are ready to be deployed to the target environment.

devops angular deployment pipeline

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Install Angular - Angular Environment Setup Process

Install Angular in easy step by step process. Firstly Install Node.js & npm, then Install Angular CLI, Create workspace and Deploy your App.

How to Extend your DevOps Strategy For Success in the Cloud?

DevOps and Cloud computing are joined at the hip, now that fact is well appreciated by the organizations that engaged in SaaS cloud and developed applications in the Cloud. During the COVID crisis period, most of the organizations have started using cloud computing services and implementing a cloud-first strategy to establish their remote operations. Similarly, the extended DevOps strategy will make the development process more agile with automated test cases.

Measuring DevOps Metrics: A How-To Guide

DevOps is supposed to help streamline the process of taking code changes and getting them to production for users to enjoy. But what exactly does it mean for the process to be "streamlined"? One way to answer this is to start measuring metrics.

What Is DevOps and Is Enterprise DevOps Any Good?

What is DevOps? How are organizations transitioning to DevOps? Is it possible for organizations to shift to enterprise DevOps? Read more to find out!

Automating deployments to on premise servers with Azure DevOps

As someone who has spent most of their (very short) career doing one click cloud resource deployments, I was shocked when I jumped onto a legacy project.