An App Service plan in Microsoft Azure specifies the resources (like RAM, CPU, and storage) available to your web app. For optimal price-performance, you would want to choose the right service plan. Better still, you could configure the scaling settings of the service plan to automatically adjust the resources according to the load on your web app. This article explores how you can configure the scaling settings as part of your preparation for the AZ-104 Microsoft Azure Administrator exam.

Table of Contents

Understanding Scaling in Azure

Before diving into the configuration, it’s essential to understand two types of scaling available in Azure – Vertical and Horizontal.

  • Vertical Scaling, also known as Scaling up or down, adjusts the capability of a server by changing the App Service plan to a higher or lower one. For example, from Standard to Premium or vice-versa.
  • Horizontal Scaling, also known as Scaling out or in, adjusts the number of server instances running the app. You can run your app on multiple instances simultaneously to handle increased load.

Depending upon the nature of the web app and the expected load, you may choose vertical, horizontal, or both types of scaling for your Service plan.

Configure Vertical Scaling

To configure vertical scaling, follow these steps:

  1. In the Azure portal, go to your web app and select “Scale up (App Service plan)” option.
  2. Select your desired tier (Basic, Standard, Premium, Isolated, or Consumption) and the specific compute resources within that tier.
  3. Click “Apply” to trigger the scaling process.

Please be aware of downtime associated with vertical scaling. Review the tiers and their capacities meticulously before finalizing.

Configure Horizontal Scaling

Here are the steps to configure horizontal scaling:

  1. Go to your web app in the Azure portal and select the “Scale out (App Service plan)” option.
  2. For manual scaling, move the slider to select the maximum number of instances you wish to run your app on.
  3. For automatic scaling, click “Enable autoscale”. Define rules based on metrics like CPU percentage, memory usage, or http queue length. Azure will create or delete instances keeping the number between minimum and maximum you define.

For example, you could add a rule such that if average CPU usage is above 70% for 10 minutes, increase count of instances by 2. Another rule could be if CPU usage is below 30% for 30 minutes, decrease count of instances by 1.

Understanding Rule Evaluation

Each autoscale rule is self-contained. If multiple rules match, Azure implements the one creating maximum instances.

For instance, if you have two rules:

  • Rule 1: If CPU > 80%, then instances +2
  • Rule 2: If Memory > 70%, then instances +1

and both conditions are true, Azure will choose Rule 1 and increment by 2 instances.

Finally, Azure evaluates each condition every five minutes and does not react instantly to load spikes.

Proper configuration of scaling settings is a critical exam topic for effective resource utilization, cost management, and app performance. While the interfaces change over time, the concepts of vertical and horizontal scaling are likely to remain a cornerstone of Azure. Be sure to test, validate, and understand these processes thoroughly for the AZ-104 examination!

Practice Test

True or False: An App Service plan in Azure defines set of compute resources that an app can scale out.

  • True
  • False

Answer: True.

Explanation: An App Service plan in Azure represents a set of compute resources for a web app to run including the amount of storage and the number of allowable scaling instances.

Multiple Select: Which of the following options can be configured during the scaling process in an App Service plan?

  • A) Number of instances
  • B) Outbound IPs
  • C) Storage type
  • D) Compute resources

Answer: A, D.

Explanation: Only the Number of instances and Compute resources can be configured in scaling settings in an App Service plan.

Single Select: In an Azure App Service, the “Scale Out (App Service Plan)” option allows you to:

  • A) Reduce the number of VMs on your Subscription
  • B) Increase the amount of Storage in your App Service Plan
  • C) Increase or decrease the number of VM instances in your App Service Plan
  • D) Move your App Service Plan to another Resource Group

Answer: C.

Explanation: The “Scale Out (App Service Plan)” option allows you to increase or decrease the number of VM instances.

True or False: You can configure an Azure App Service plan to automatically increase or decrease based on actual CPU usage.

  • True
  • False

Answer: True.

Explanation: Azure App Service allows enabling autoscale which can adjust the number of VM instances up or down in response to actual CPU usage.

Single Select: What feature of Azure App Service Plan allows to adjust the number of VM instances based on actual CPU usage?

  • A) Manual Scale
  • B) Scale In
  • C) Auto Scale
  • D) Scale Out

Answer: C.

Explanation: Auto Scale in Azure App Service Plan allows to adjust the number of VM instances based on actual CPU usage.

True or False: It is not possible to manually adjust the number of instances in an App Service plan.

  • True
  • False

Answer: False.

Explanation: Azure App Service plan does provide an option for Manual Scale where you can manually adjust the number of instances.

Multiple Select: Which of the following are types of scaling in Azure App Service Plan?

  • A) Vertical Scaling
  • B) Horizontal Scaling
  • C) Diagonal Scaling
  • D) Circular Scaling

Answer: A, B.

Explanation: Vertical Scaling means increasing or decreasing the compute power, whereas Horizontal Scaling means increasing or decreasing the number of instances.

True or False: Increasing the number of instances in a web app offers improved performance and better load distribution.

  • True
  • False

Answer: True.

Explanation: Increasing the number of instances can indeed improve the performance and manage the load distribution efficiently.

Single Select: Which type of scaling increases the compute power of the existing App Service plan?

  • A) Vertical Scaling
  • B) Horizontal Scaling

Answer: A.

Explanation: Vertical scaling refers to increasing or decreasing the compute power, i.e., switching to a more powerful compute tier or down to a less powerful one.

True or False: Each instance of an App Service plan shares the same set of deployed web applications.

  • True
  • False

Answer: True.

Explanation: Each instance of an App Service plan indeed shares the same set of deployed web applications. The total resources available is divided evenly among these instances.

Multiple Select: Which of the following are valid metrics for Autoscale in Azure?

  • A) Memory percentage
  • B) Disk Queue Length
  • C) Data Out
  • D) Number of registered users

Answer: A, B, C.

Explanation: Azure Autoscale can be based on Memory percentage, Disk Queue Length, and Data out. There is no way to scale based on number of registered users directly.

Single Select: In Azure, the scale-out rule can be based on which of the following?

  • A) A schedule
  • B) A metric
  • C) Both
  • D) Neither

Answer: C.

Explanation: Azure allows to create scale rule based on a metric (CPU usage, memory, etc.) or a schedule (time of the day, day of the week).

True or False: It is not possible to scale an App Service Plan to zero instances.

  • True
  • False

Answer: True.

Explanation: The App Service Plan must always have at least one running instance.

Single Select: Which pricing tier of Azure App Service Plan does not support Autoscale?

  • A) Free
  • B) Basic
  • C) Premium
  • D) Standard

Answer: A.

Explanation: The Free tier does not support Autoscale. Autoscale is available in Basic, Standard and Premium plans.

True or False: You have to stop running your app when you change the App Service scale settings.

  • True
  • False

Answer: False.

Explanation: Changing the scale settings doesn’t mean you have to stop your app. It continues running as Azure adds or removes instances based on your scale settings.

Interview Questions

What is an App Service plan in Microsoft Azure?

An App Service plan in Azure represents the physical resources where your web apps run. These resources are isolated and secure, with features like custom domains and SSL certificates, autoscale, and other features.

How many App Service plans can you have per resource group?

You can have multiple App Service plans per resource group in Azure. The limits are defined by your Azure subscription.

Can apps in the same App Service plan run on different regions?

No, all apps in the same App Service plan run in the same region.

What is autoscale in Azure?

Autoscale is a built-in feature of Cloud Services, Mobile Services, Virtual Machines, and Websites that helps applications perform their best when demand changes. It can automatically scale the number of instances up or down according to the rules you define.

How do you enable autoscaling for an App Service plan?

To enable autoscaling for an App Service plan, you can go to the Azure portal, select your App Service plan, and then under the settings, select the Scale Out (App Service plan) option. From there, you can enable autoscaling and define the rules for scaling.

How many autoscale rules can you create per Azure subscription?

You can create up to 100 autoscale settings (rules) per Azure subscription.

Can you configure autoscaling based on a schedule?

Yes, in Azure you can configure autoscale settings to scale according to a pre-set schedule. For example, you can configure the scale to increase during business hours and decrease during non-business hours.

What metric types can be used to configure scaling in Azure App Service Plan?

You can create autoscale settings based on a variety of metric types including CPU percentage, memory percentage, disk queue length, HTTP queue length, and Data In and Data Out.

What are the types of autoscale available in Azure?

In Azure, there are three types of autoscale available: Scale based on metric, scale to a specific instance count and scale by a schedule.

What is the maximum number of instances that an Azure App Service plan can scale to?

Depending on the pricing tier, an Azure App Service plan can scale up to 20 instances for B1/B2/B3 plans, and up to 100 instances for the Premium plan.

What is the purpose of the “Cool down minutes” in the Azure autoscale settings?

The “Cool down minutes” define the amount of time to wait after a scaling action before performing another check. This allows the application to stabilize before another scale operation is performed.

Can autoscale rules be set for individual apps in an App Service Plan?

No, autoscale settings are applied at the App Service plan level, not per individual app.

Can you scale an App Service manually in Azure?

Yes, besides autoscaling, you can also scale an App Service manually by increasing or decreasing the number of running instances.

What happens when the limit of the defined autoscale rules for a subscription is reached?

When the limit of autoscale rules for a subscription is reached, you cannot create new autoscale settings until you delete existing ones.

Can you set autoscale rules to trigger based on a Service Bus queue length?

Yes, you can set an autoscale rule to trigger based on the length of a Service Bus queue. This can help you automatically scale your service to handle periods of high message load.

Leave a Reply

Your email address will not be published. Required fields are marked *