When to use azure virtual machines

In this video we will discuss when to create and use a virtual machine over serveral other services offered by Azure like App Service, Function Apps, Container instances, Service Fabric etc.

Let's say I have a standard web application. Something like a typical n-tier application, with a RESTful service accessing a database server.

why use virtual machines

It doesn't really matter what technology we have used to build this web application. ASP.NET Web forms, MVC, Java, PHP, or Python. If you want to host your web application, you may use an Azure App Service. There is no need for you to use a Virtual Machine. However, there are several use cases, why we may want to create and use a virtual machine.

What is an Azure App Service

what is azure app service

Well, we will discuss it in detail in our upcoming articles. For now, you can think of it as a managed service for hosting web apps, mobile app back ends, RESTful APIs, or even automated business processes.

Azure App Service v/s Virtual Machine

Azure App Service is a "Platform as a Service" offering. It is a fully managed environment. The cloud service provider (in this case Azure) manages the underlying infrastructure (i.e Servers, Networking, Storage and even Virtualization). They are also responsible for installing the operating system updates, critical patches, runtime or middleware components. We just manage the application that we are building and it's data. 

azure app service vs virtual machine

Virtual Machine on the other hand is an "Infrastructure as a Service" offering. The following are some of the reasons why you may choose to create a virtual machine over using a platform as a service offering, such as an Azure App Service.

why use azure virtual machines

Complete control over your development, test and staging environments

You want to have complete control over your computing environment like development, test or staging. May be you want to use your own custom operating system image or the application that you are developing is such that, you may want to install your own custom middleware and runtime components. So, basically, the application that you are developing has strong dependencies on the server and you want to take infrastructure related things like networking, load-balancer, scale-out and scale-in, web server management, and so on into your own hands. In short, you want to have total control over your development environment.

Migrate legacy apps to the cloud

May be you have an on-premise legacy app that depends on custom middleware and runtime components. You want to migrate this app to the cloud, but since this is a legacy app with it's own custom middleware and runtime requirements, it does not have an equivalent platform as a service offering. So you may want to create and use a VM instead. With the VM you have complete control. You can install any custom software components you want. Basically it provides the easiest migration path i.e you can even lift and shift an on-premise custom legacy app to a VM in the cloud.

Extend on-premise datacenter

Extend your on-premise datacenter and create hybrid cloud to which we can burst through if there are spikes in demand for our application, or may be you just want to use it as a back up, fail over or disaster recovery site.

Azure offers several compute services like the following

  • App Service
  • App Service Container
  • Virtual Machines
  • Azure Batch
  • Azure Functions
  • Service Fabric
  • Container Instances
  • Azure Kubernetes Service

Which compute services to use depends on several factors like the following 

  • Are you creating a new application or migrating an existing application?
  • If you are migrating an existing application do you want to just lift and shift your existing application to cloud? or
  • Do you want to optimise to cloud and then migrate?
  • Does your app have any dependencies on the server?
  • Can those server dependencies be containerized?
  • Do you want to use microservices architecture?

Which compute services to use really depends on the answers to these questions. If your application consists of multiple workloads, evaluate each workload separately. A complete solution may require two or more compute services.

The following flowchart from MSDN really useful to decide which compute services to use for your solution. We will discuss these compute services in our upcoming articles.

which azure compute service to use

Azure tutorial for beginners

© 2020 Pragimtech. All Rights Reserved.