This post has been republished via RSS; it originally appeared at: ITOps Talk Blog articles.
I recently saw a discussion on what value does the cloud actually bring to people. Why migrate? Beyond the most stated reasons, elasticity (aka add a host, VM, app or container on the fly), resiliency with Azure regions, Availability sets and zones. Maybe we should ask why wouldn't you migrate applications that make sense to move from on-premises to Azure?
There will always be debate on what's right for your organization but there are many ways you can benefit from cloud. I thought it simplest to start with a web application. These can be run on a physical server, a virtual machine, a container but you can also run them as an Application Service in Azure.
Have I done this before? No. I followed these instructions with some modifications that I'll show in this post. Is it a Hello World type of output? Yes, but we all start somewhere.
Azure App Service
You can deploy pretty much any flavor to the Azure App Service; Node.js, Python, Wordpress, Java. etc and even a static HTML site. I chose ASP.NET which also has different (.NET) versions and are supported. Azure App Service is also cross platform functional so you can host on Linux or Windows. Along with being able to scale, and self-patch while hosting your web service. There are also different platforms to deploy from depending on your comfort level - PowerShell, Visual Studio, Visual Studio Code, Azure Portal and Azure Cli. I used PowerShell when the .NET Cli commands are referenced.
Creating an ASP.NET Web APP
So open up PowerShell make sure you have the Pre-requisites mentioned in the Learn Module
In the Learn Module, it references the .NET CLI because we're basically running the .NET commands but, in our PowerShell Terminal,
Creating a new webapp called MyFirstAzureWebApp and changing the local directoy to MyFirstAzureWebApp
In the terminal you will then see
Now we're going to run this locally with the command:
If you open up a web browser, you'll get a lovely ASP.NET Welcome template page.
Now we have it created locally, let's push it to Azure.
Publish the Web App
I had to use this command because we have dual factor authentication
Now we create a new resource group, App Service plan and App Service resource in Azure by using the "New-AzWebApp" command also giving it a name and location.
Now back to your local setup you can prepare our fancy website for deployment to Azure
On the terminal use
Change to the release directory with
Now you have that zip file local and the next step says to push it to Azure. I did this by uploading the file using the cloudshell
After uploading the zip file I ran the command in cloudshell to Publish
Now I can go to the published URL and see the same website.
The rest of the Learn Module is fun to do, you update the html page and end up overwriting the original home page of the web app and end up with below. To follow those remaining steps follow here
I wanted to show 1 how easy it is to get a simple app up and running there are also instructions on deploying with an Azure SQL Database - Deploy an ASP.NET Core and Azure SQL Database app to Azure App Service - Azure App Service
Now that we are in Azure, we can scale up or out manually or automatically, provide load balancing and start integrating DevOps capabilities (staging environments, continuous deployment, etc). App Service is a PaaS offering providing a managed hosting service for web apps like the one we built. You can also deploy in different ways: as code, VMs or containers and have security and compliance requirements for your Production environment. Microsoft Defender will point out vulnerabilities and give you ways to mitigate.
My Web App now has alerts, metrics, deployment slot options, authentication settings, identity and backup options as well as changing the App Service plan for autoscaling needs.
There is also a great flowchart here that can start you out on what compute make sense to lift and shift vs being optimized to run in the cloud.
You can also read more on the reasons why here. No matter how you decide to start I think it's enjoyable to see what options you have when migrating or starting a new application in the cloud.
Thanks for reading and leave any comments below!