Azure App Service and Web Apps
App Service and App Service plans
Before we
talk about Web Apps, let’s talk about App Service and the App Service plans.
What is
an App Service?
The App
Service is a service that hosts one of five kinds of applications:
Web Apps
Mobile Apps
Logic Apps
API Apps
Function
Apps
Each app runs in its own app service. When you look
in the Azure portal to see your website, you will look for the app service in
which it is running. It conveniently has the same name as the app it’s hosting.
So what
is an App Service plan?
An App Service
plan defines the capacity and resources to be shared among one or more app
services that are assigned to that plan.
The
following are some of the criteria you can define when creating an App Service
plan.
Location (such as West US)
Instance count
Pricing tier (such as Free, Standard, or Premium) providing distinct settings
for a variety of performance and service capabilities:
Number of cores or instance size
Amount of memory
Amount of storage
Maximum number of instances
Autoscaling
options (depends on tier—automatic, manual, or none)
When you
deploy your app service for the first time, you specify which App Service plan
you want to use. At deployment time, you can select an App Service plan you
have created or create a new App Service plan.
How
does this help you?
With
infrastructure as a service (IaaS), you can create your own virtual machines
(VMs), deploy your apps to them, and deal with the IIS setup and application
pools and so on. Then, every time you change an app, you have to deploy it to
all the VMs again. If you scale it out, and you have four VMs or eight VMs, it
just becomes more onerous. With IaaS, you are responsible for the continuing
management of your service.Using App Service plans enables you to run multiple
applications on one set of VMs, even if each of the applications is deployed
separately.
For
example, let’s say you have five websites and three mobile apps that you want
to host. You could run each one on its own VM, which would require 8 VMs. If
you wanted redundancy (recommended), that would require 16 VMs. Even if you
select small instances, the cost adds up really quickly. Plus, you have to
scale each set of VMs separately.
If you
could run those eight applications on the same set of two VMs, it would be more
cost-effective and easier to manage. This is what using App Service plans does
for you. You set up one App Service plan with a specific VM size, number of
instances, etc. Then, you deploy the eight applications, specifying the same
App Service plan for each one. This results in all eight applications running
on that same set of two VMs. You can deploy and update each application as
needed—you don’t have to update them all at the same time.
When you
create your App Service plan, the resources you requested are allocated for
you. When you deploy an app to that App Service plan, it simply deploys the
applications to those allocated resources.
If you
decide you want to have four VMs instead of two, you simply go to the Azure
portal and modify the App Service plan, changing the number of instances from
two to four. It will create two more VMs and deploy your apps to them for you.
If you are using small VMs and want to scale up to medium VMs, you can simply
modify the Pricing Tier in the App Service plan, and it will scale up.
With web apps running in an app service using an App
Service plan, the management is handled for you, and you can easily scale up
and out just by changing the settings of the App Service plan.