The majority of the 101 series so far has been has been focused on specific categories of services and although I will be continuing with those, I wanted to stop and talk about a pretty common deployment model that occurs within Azure especially for those that are just getting started with Platform as a Service (PaaS) services. Matter of fact, this migration/modernization is happening a lot within the Federal Government space as there are still a number of agencies that are just getting started in the Cloud and within Azure.
The pattern that I am referring to is the migration of a web application into Azure PaaS services and this usually takes the form of a combination of Azure App Services and Azure SQL or other Database as a Service based services, like MySQL, PostGreSQL, or MariaDB. In many cases, these applications can easily be deployed directly into these services, but every once in a while some modernization based development needs to be applied to make sure that the application will work properly in these Cloud native services.
This particular blog post is not going to focus on the modernization steps that may arise, but instead focus on just the basic understanding of the common services that you will be using to perform a simple .NET based migration into Azure using Azure App Services, Azure SQL, and leveraging Azure DevOps for Continuous Deployment into these services.
Let’s start talking about this by focusing on the code side of things. How is your code going to make it into Azure App Services? There are simple ways that do not require any kind of DevOps pipelines and then there are truly complex scenarios that may require automation and integration. I cannot do a thorough deep dive of the Azure DevOps product as there are two many features and functions, but I can certainly talk about the service from an Azure 101 perspective by focusing on the easiest way to use the service from a Application Migration perspective.
The first question, where is your code going to be managed so that multiple developers can make changes to it and that is where Azure DevOps Repos come into play. They can be created in both Git and the traditional TFS flavors depending on what you are the most familiar with and they are very easy to get started with, especially if you are using Visual Studio or VS Code as your IDE of choice. Just login to your Azure DevOps project and then choose the Repo that you will be working with at which point you will be able to synchronize your code or do a clone/check-in of the code.
Once you have your code in a source code repository within Azure DevOps, you can now setup Continuous Delivery or Deployment into Azure App Services. This can be done in two different ways, one is through an instigation at the App Service layer which would be considered a Pull motion and the second is instigated by Azure DevOps which is of course considered a Push motion.
The first can very easily be be setup through the Deployment Center wizard within the Azure App Service, where the other one requires a Azure DevOps Pipeline where it can pull the final code deliverable and push that code into an Azure App Service. A quick demo of the Deployment Center model can be seen in the below video. As for the Azure DevOps Pipelines option, there is documentation at the bottom of the blog post that provides a .NET Core example.
Needless to say, this is a very simple process of how a .NET application would be deployed into Azure App Services and it only takes advantage of two of the available services within Azure DevOps, but it is a quick way to get started with Azure DevOps. In addition to the videos that I have already provided, I have also created a quick 101 level video of Azure DevOps, where I talk about each of the available services and what they can be used for within a given software engineering project, please see below:
Azure App Services
The next area to talk about is the Azure App Service where the application will be made available to your user base. Azure App Services is considered to be Platform as a Service, because you never have to worry about VMs, or Operating Systems, or even Application Server software, you only need to worry about your application, how it is configured and then how it will need to perform for its users. Microsoft takes care of everything else for you and it truly is one of the most feature rich services within Microsoft Azure.
As a quick overview, Azure App Services allows you to deploy your code to this platform, which supports many different languages and versions and if it doesn’t support the one you are using out of the box, then you can bring your own custom container. You then choose the operating system and the deployment model, which boils down to different instance configurations (Number of Procs, Memory, etc.). These instance configurations do allow for scaling options to be configured so that you can truly support any number of possible concurrent users within a given Azure region. Once everything has been created and the code has been pushed to the one-to-many instances, then you will be given a Microsoft generated URL that you can use or you can bring your own domain to publish to the world and now you have a public facing application.
Matter of fact, there are so many different configuration options within App Services, that I had to split my 101 video into two with one focused on the App Service creation and what options are available within the creation wizard and the other is a deeper dive of all the configuration options that you see in the navigation for your newly created App Service. Each of those videos can be seen below:
Considering that there are so many features and configuration options, there is no way for me to provide you with short vides talking about or demonstrating all of them. So I got you started in my above videos, but for anything you need more information about, you will need to take a look at the documentation which you can find below in the Additional Resources section.
Database as a Service
The last area to talk about within the scope of this Simple PaaS Deployment use case, is the database. Microsoft provides many different flavors of database as a service where they will provide you with the instance(VM) with an installed OS and installed database software (SQL Server, MySQL, PostGreSQL, MariaDB), all you need to do is configure it and then migrate your data into it. Microsoft also provides a number of NoSQL options as well, but they are native first-party flavors of NoSQL. If you want something like MongoDB or CouchBase, then you will have to deploy those yourself using virtual appliances.
For the purposes of this use case, because we are talking about .NET applications, I am focusing on the Azure SQL service. However, the other flavors of SQL based database as a service provide many of the same features and configuration options if they are more your speed. I do plan on doing a similar blog post where we focus on the LAMP stack and in that one, we will use the Azure MySQL service.
The Azure SQL Service is a full fledged implementation of the absolute latest version of SQL Server Enterprise. Matter of fact, Microsoft pushes as new features for SQL Server into Azure SQL first before making them available as updates to those who have it installed On-Prem.
You choose your instance/database size which includes number configuration options for virtual cores, amount of memory available and available storage for the database. There are many different options depending on how your database is going to be used. Once your database service is created and configured, you can then move your data into and connect to it just like you would any other installation of SQL Server with the only difference being that the connection string will contain a public endpoint. In addition, Microsoft also provides a Database Migration Service to make it as easy as possible to move your data into any of its database services.
With this as an overview, let’s take a look at a walkthrough of the Azure SQL Service:
Hopefully this gives you a good place to get started with the task of migrating your .NET based web applications into the Cloud and specifically into Microsoft Azure. This is definitely not an exhaustive discussion of any of the services that I have mentioned. It is just meant as a starting point for understanding what is available and where you might want to get started. Please feel free to leave me any comments if you have any questions or your see any errors in what I have said.