This is Part 13 of azure tutorial. In this video, we'll discuss when to create and use a virtual
machine over several other services offered by azure like app service, function apps, container
instances, service fabric etc. This is one of the confusions I had, when I started learning azure.
Let's say, I have a standard web application, something like a typical n-tier application
with a restful service accessing a database server. 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. Now, what is an azure app service? Well, we'll discuss it in detail in
our upcoming videos. For now, you can think of it as a managed service for hosting web applications,
mobile application backends, restful API's or even automated business processes. Azure app service is
a platform as a service (PaaS) offering. It's a fully managed environment. The cloud service
provider, in this case Microsoft 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 its data. Virtual machine on the other hand is an infrastructure
as a service (IaaS) 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.
One of the reasons could be, you want to have complete control over your computing environment
like development, test or staging. Maybe 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're 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. So,
in short you want to have total control over your development environment. Another reason could be,
maybe 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 its
own custom middleware and runtime requirements, it may not have an equivalent platform as a service
offering. So, you may want to create and use a VM instead. With the virtual machine, you have
complete control. You can install any custom software components you want. Basically,
it provides the easiest migration path, that is, you can even lift and shift an on-premise custom
legacy app to a virtual machine in the cloud. Another reason could be, you want to extend
your on-premise data-center and create a hybrid cloud to which we can obviously burst through
if there are spikes in demand for our application or maybe you just want to use it as a backup,
failover or disaster recovery site. Azure offers several compute services like the following.
Now, here's the important bit to take away. Which compute service to use
depends on several factors like the following. Are you creating a new application or migrating
an existing application? If you're migrating an existing application, do you want to just lift and
shift your existing application to the cloud or do you want to optimize to cloud and then migrate?
Does your application have any dependencies on the server? Can those server dependencies be
containerized? Do you want to use microservices architecture? So, which compute service to use
really depends on the answers to these questions. If your application consists of multiple workloads
then evaluate each workload separately. A complete solution may require two or more compute services.
I found the following flowchart from MSDN really useful to decide which compute service to use
for your solution. For example, let's say we are building a brand new application. The first
question we have to ask ourselves is, do we want to have full control over our development
environment? If the answer to this question is YES, then probably virtual machine is our best
bet. With a virtual machine, we have complete control over our development environment. We
can install any software we want - middleware components, runtimes etc. We can even install
our own custom operating system image if we want to. So, the point that I'm trying to make is,
this flowchart is really useful to decide which compute services to use for our application.
Now, if you're new to these compute services, we'll discuss them in our upcoming videos.
In the meantime, if you have any suggestions, questions or topics that you want me to discuss,
please leave them as comments. That's it in this video. Thank you for listening.