Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Lesson 28 of 47
❮Prev Next❯

App Service Plans, Scaling and Creating a Web App

Module 3: Compute ⏱ 12 min read Updated

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    All my bookmarks and notes

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    30-second answer

    An App Service plan is the set of VMs your web apps run on. Its pricing tier decides the instance size, how many instances you can have and which features you get: Free and Shared for testing, Basic (up to 3 instances, manual scale), Standard (up to 10, autoscale and 5 deployment slots), Premium v3 (up to 30, 20 slots, zone redundancy) and Isolated v2. Every app on a plan runs on every instance. Scale up changes the tier or size; scale out changes the instance count, by hand or with rules-based autoscale on a metric such as CPU percentage.

    Simulate it » No Azure account needed

    Exam objective: 3.4.1 Provision an App Service plan. 3.4.2 Configure scaling for an App Service plan. 3.4.3 Create an App Service. (Skills measured as of April 17, 2026)

    Simulations

    Feel it before you read it. No account needed, nothing leaves this page.

    Azure portal: Create an App Service plan and a web app, then scale up and out Create a plan and a web app, then scale up and out.
    </> Embed

    Embed this simulation

    Free for trainers, teachers and bloggers. Paste this into your page:

    Loading the portal…

    Start on <strong>Home</strong>. Select the search bar.

    👆 Click the glowing item in the portal to continue

    Read the steps as text
    1. Start on Home. Select the search bar.
    2. Type app service plans in the search bar and pick App Service plans under Services.
    3. The plan is the compute: region, OS and pricing tier decide the VMs your apps run on and the features they get. B1 ≈ $13 a month per instance (illustrative).
    4. Review and Create.
    5. Create the web app and put it on that plan. Same region and OS, or the plan won’t show in the list.
    6. On the plan, Scale out adds instances. Basic lets you set up to 3 by hand. Every app on the plan runs on every instance.
    7. Scale up changes the tier. Pick Standard S1 to unlock autoscale and deployment slots. The apps restart on the new hardware.
    8. Now choose Rules Based, then set the instance limits: never fewer than 2, never more than 6.

    🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.

    😟 THE PROBLEM

    Black Friday is coming and the shop runs on one small instance.

    😊 THE SOLUTION

    Pick the right plan tier, then scale out with autoscale rules.

    • One busy instance✓ Scale out
    • Missing features✓ Scale up a tier
    • Nobody watching at 3 AM✓ Autoscale rules
    🛠️ Solved with: App Service plan scaling

    Start with a question

    Is it the shop that's busy, or the building it's in?

    Picture a food court. Several stalls share one building, one electricity bill and one set of kitchens. If the whole food court gets crowded, you can move to a bigger building (more power per kitchen) or open more identical kitchens next door.

    An App Service plan is the building. The web apps are the stalls inside it. Moving to a bigger building is scale up. Opening more kitchens is scale out. And because the stalls share the building, everything you do to it happens to all of them.

    Explain it like I’m 10

    The technical explanation

    Provision an App Service plan

    Portal: search App Service plans → + Create. On Basics: subscription, resource group, Name, Operating System (Linux or Windows), Region and Pricing plan (select Explore pricing plans to compare). Zone redundancy needs Premium v2 or v3. Review + create.

    az appservice plan create -g rg-admin-web -n asp-contoso-shop --sku B1 --is-linux --number-of-workers 1
    New-AzAppServicePlan -ResourceGroupName rg-admin-web -Name asp-contoso-shop -Location eastus -Tier Basic -WorkerSize Small -NumberofWorkers 1 -Linux

    What each tier gives you

    TierMax instancesAutoscaleDeployment slotsCustom domain + TLSNotes
    Free (F1)1 (shared)NoNoNo60 CPU minutes a day, for tests
    Shared (D1)1 (shared)NoNoDomain only, no TLS bindingWindows only
    Basic (B1–B3)3No (manual)NoYesBackups, VNet integration
    Standard (S1–S3)10Yes5YesDaily backups
    Premium v3 (P0v3–P5mv3)30Yes, plus automatic scaling20YesZone redundancy, bigger sizes
    Isolated v2 (I1v2–I6v2)100Yes20YesRuns in an App Service Environment

    As a feel for cost, Basic B1 is about $13 a month per instance, Standard S1 about $73 and Premium v3 P1v3 about $124 (illustrative Linux prices).

    Create an App Service (web app)

    Portal: search App Services → + Create → Web App. Basics: Name (becomes <name>.azurewebsites.net), Publish (Code or Container), Runtime stack, Operating System, Region, then the Linux/Windows Plan and Pricing plan. The plan list only shows plans in the same region and OS. The other tabs cover Database, Deployment (GitHub Actions), Networking, Monitor + secure (Application Insights) and Tags.

    az webapp create -g rg-admin-web -p asp-contoso-shop -n app-contoso-shop01 --runtime PYTHON:3.12
    New-AzWebApp -ResourceGroupName rg-admin-web -Name app-contoso-shop01 -Location eastus -AppServicePlan asp-contoso-shop

    Scale up and scale out

    Both live on the plan, and you can reach them from the plan or from any app on it: Scale up (App Service plan) and Scale out (App Service plan).

    # scale out by hand (Basic allows up to 3)
    az appservice plan update -g rg-admin-web -n asp-contoso-shop --number-of-workers 3
    # scale up to Standard to unlock autoscale and slots
    az appservice plan update -g rg-admin-web -n asp-contoso-shop --sku S1
    Set-AzAppServicePlan -ResourceGroupName rg-admin-web -Name asp-contoso-shop -Tier Standard -NumberofWorkers 2

    Scaling up moves the apps onto new instances, so they restart. Scaling out adds instances behind the built-in load balancer and leaves the running ones alone.

    Autoscale rules

    In Scale out (App Service plan) the Scale out method has three choices: Manual, Automatic (platform-managed HTTP scaling on Premium v2/v3) and Rules Based (an Azure Monitor autoscale setting). For rules you set:

    • Instance limits: minimum, maximum and default (used if metrics are missing).
    • Scale-out rule: for example CPU Percentage > 70 averaged over 10 minutes → increase count by 1, cool down 5 minutes.
    • Scale-in rule: for example CPU Percentage below 30 → decrease count by 1. Always pair them.
    az monitor autoscale create -g rg-admin-web --resource asp-contoso-shop \
      --resource-type Microsoft.Web/serverfarms --name asp-contoso-shop-autoscale \
      --min-count 2 --max-count 6 --count 2
    az monitor autoscale rule create -g rg-admin-web --autoscale-name asp-contoso-shop-autoscale \
      --condition "CpuPercentage > 70 avg 10m" --scale out 1
    az monitor autoscale rule create -g rg-admin-web --autoscale-name asp-contoso-shop-autoscale \
      --condition "CpuPercentage < 30 avg 10m" --scale in 1

    Other useful plan metrics are Memory Percentage and Http Queue Length. You can also add a schedule profile, such as 4 instances every weekday from 08:00 to 18:00.

    Architect level How many apps per plan?

    There’s no fixed number. Put apps on the same plan when they’re small, owned by the same team and scale together; it saves money. Split them when one app’s load would starve the others, when they need different tiers or regions, or when you want separate bills. Remember a deployment slot is also an app on the plan and uses the same instances.

    Real-world business scenario

    E-commerce

    Contoso Shop (fictional)

    The problem
    The online shop ran on one Basic B1 instance. Every sale weekend the site slowed down and someone had to scale it by hand late at night.
    What they used
    The plan was scaled up to Standard S1 and given a rules-based autoscale setting: minimum 2, maximum 6, add one instance when CPU averages over 70% for 10 minutes, remove one under 30%, plus a weekend schedule profile starting at 4 instances.
    Why that choice
    Standard is the lowest tier with autoscale and slots, two instances give basic redundancy, and the scale-in rule keeps the bill from staying high after the rush.
    The result
    The last sale weekend peaked at 5 instances with steady response times, and nobody was paged.

    When to use it and when not to

    ✓ Use it when…

    • Web apps and APIs that need a managed platform with TLS, slots and backups.
    • Steady or predictable traffic where a few always-on instances make sense.
    • Several small apps that can share one plan and one bill.

    ✕ Think twice when…

    • Workloads that sit idle most of the day and should cost nothing then. Container Apps scales to zero.
    • Short jobs that run and stop. Use Container Instances or Functions.
    • Software that needs full control of the OS. Use a VM.

    ↔ Alternatives to consider

    • Azure Container Apps for containers that scale on traffic, down to zero.
    • Azure Functions for event-driven code billed per execution.
    • Virtual Machine Scale Sets when you need the OS and autoscale together.
    Ready for more?The full lesson adds the technical explanation, when to use it, interview questions and revision notes.

    Test yourself with exercises

    5 original practice questions in the AZ-104 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.

    Question 1

    Question 1 of 5

    A web app runs on an App Service plan in the Basic B1 tier. You need the plan to add instances automatically when average CPU usage exceeds 70 percent.

    What should you do first?

    Question 2

    Question 2 of 5

    An App Service plan hosts three web apps. You scale the plan out from two instances to four instances. Which statement is true?

    Question 3

    Question 3 of 5

    You need to create a web app by using the Azure portal. The App Service plan named asp-west does not appear in the plan list. The plan uses Linux in West US. The web app is configured for Windows in West US. What should you change?

    Question 4

    Question 4 of 5

    A company needs an App Service plan that supports up to 25 instances and 15 deployment slots for one app. Costs must be minimized.

    Which pricing tier should you choose?

    Question 5

    Question 5 of 5 · Select 2

    You configure rules-based autoscale for an App Service plan. Which two settings should you configure so that the plan grows under load and shrinks when the load ends? Each correct answer presents part of the solution.

    Interview preparation

    Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

    Beginner What's the difference between an App Service plan and a web app?

    Model answer

    The plan is the hardware: a set of VMs with a tier and an instance count. The web app is my code or container running on that plan. Several apps can share one plan, and they all share its instances and its bill.

    Intermediate When do you scale up and when do you scale out?

    Model answer

    I scale up when each instance is too small, for example memory runs out, or when I need a feature the tier doesn't have, like deployment slots on Basic. I scale out when the load is many requests that can be shared, so more copies help. Autoscale only works on scale out, and only from Standard up.

    Experienced developer How would you set up autoscale for an App Service plan?

    Model answer

    In Scale out I'd pick Rules Based, set minimum, maximum and default instance counts, then add a scale-out rule such as CPU Percentage greater than 70% averaged over 10 minutes, increase by 1, cool down 5 minutes, and a matching scale-in rule like CPU below 30%, decrease by 1. Without the scale-in rule the plan grows and never shrinks. In the CLI that's az monitor autoscale create with --resource-type Microsoft.Web/serverfarms, then az monitor autoscale rule create.

    Scenario One noisy app on a shared plan slows the others down. What do you do?

    Model answer

    Scaling the plan would scale every app on it, which wastes money on the quiet ones. I'd move the noisy app to its own App Service plan in the same region, then size and scale that plan for it alone.

    Quick revision

    Key points

    • The plan is the compute. Region, OS and tier are set on the plan; the web app runs on it.
    • Basic scales out by hand to 3 instances. Standard allows 10 and autoscale. Premium v3 allows 30.
    • Standard gives 5 deployment slots, Premium v3 gives 20. Custom domains with TLS start at Basic.
    • Scaling acts on the plan, so every app on the plan scales together.
    • Rules-based autoscale needs a minimum, a maximum, a default and pairs of scale-out and scale-in rules.

    Important terminology

    App Service plan
    The compute behind App Service apps. A region, an OS, a pricing tier and a number of instances, shared by every app on the plan.
    Pricing tier
    The plan's SKU family (Free, Shared, Basic, Standard, Premium v3, Isolated v2) that sets instance size, instance limits and features.
    Scale up
    Moving the plan to a bigger size or a higher tier. Vertical scaling.
    Scale out
    Adding instances to the plan. Horizontal scaling.
    Autoscale setting
    An Azure Monitor resource that changes a plan's instance count between a minimum and maximum, based on rules or a schedule.
    Cool down
    How long autoscale waits after a scale action before it can act again, so it doesn't flap.
    Automatic scaling
    A platform-managed scale-out option on Premium v2 and v3 plans that reacts to HTTP traffic without rules.

    Common mistakes

    • Trying to add autoscale or slots on a Basic plan.
    • Writing only a scale-out rule, so the plan never shrinks.
    • Creating the web app in a different region from the plan you meant to use.

    Exam tips

    • "Scale automatically on CPU" = Standard or higher with an autoscale rule.
    • "More CPU and memory per instance" = scale up.
    • "Minimise cost for a dev site with no custom domain" = Free (F1).

    Five quick revision questions

    1. 1.How many instances can a Basic plan run?Show

      Up to 3, scaled manually.

    2. 2.Which is the lowest tier with autoscale?Show

      Standard.

    3. 3.How many deployment slots does Premium v3 allow?Show

      20.

    4. 4.Which command changes a plan's tier?Show

      az appservice plan update --sku <SKU>.

    5. 5.Which resource type do you autoscale for App Service?Show

      Microsoft.Web/serverfarms (the plan).

    Official references

    Finished this lesson? Tick it off. Your progress is saved in this browser.

    Next up: App Service Custom Domains, Certificates and TLS

    Studying with a friend? Send them this lesson

    It's free and needs no sign-up. Their progress saves in their own browser.

    Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges. Play ❯

    Install MSDEVBUILD Azure

    Free · no account · works offline

    Save the whole course for offline ›

    Hi, I’m your Nimbus

    Your study buddy. Pick what we do next.

    MSDEVBUILD · Multi-Stack Dev Build

    Sign in to MSDEVBUILD

    One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.