
Scalability is key when it comes to Azure Microsoft.Web/Serverfarms, and you can scale your server farm up to 200 instances in a single request.
You can automate scaling based on CPU usage, with a minimum of 1 instance and a maximum of 200 instances.
Azure Microsoft.Web/Serverfarms have a limit of 200 instances per server farm, which is a lot of power at your fingertips.
To automate scaling, you can use Azure's built-in scaling policies, which can be set up to scale based on CPU usage, memory usage, or a custom metric.
For another approach, see: Cloud Infrastructure Azure
Configuration and Settings
You can configure your Azure App Service plan with various settings to meet your needs. The required CPU and memory can be specified in the ResourceConfig section, where CPU is denoted by the 'cpu' field and memory by the 'memory' field.
To enable elastic scaling, you'll need to set the 'elasticScaleEnabled' field to true in the AppServicePlanProperties section. This will allow your apps to scale as if the ServerFarm was an ElasticPremium sku.
You can also specify the hosting environment profile using the 'hostingEnvironmentProfile' field in the AppServicePlanProperties section. This allows you to use a specific App Service Environment for your App Service plan.
Here's a list of some key settings you can configure in your App Service plan:
Resource Config
Resource Config is a crucial aspect of setting up your infrastructure, and it's essential to understand what goes into it. You can define the required CPU in cores, for instance, using the "cpu" parameter, which accepts an integer value, such as 0.5.
The "memory" parameter is also important, and it's specified as a string, like "1Gi". This parameter helps ensure that your resources have sufficient memory to run smoothly.
Here's a breakdown of the key parameters you'll need to consider:
By understanding these parameters and their values, you can create a solid foundation for your infrastructure, ensuring that it meets your needs and runs efficiently.
Parameters

When configuring an App Service plan, you'll need to specify some essential parameters. The name of the plan is required, and it can't be changed without creating a new App Service.
The location of the plan is also crucial, as it determines the Azure Region where the App Service will exist. You'll need to choose a valid location from the list of available options.
The operating system type is another important parameter, which can be either Windows, Linux, or WindowsContainer. This choice will affect the type of App Services that can be hosted in the plan.
The resource group name is also required, and changing it will force the creation of a new App Service. This is because the resource group is the container that holds the App Service plan.
Here are the required parameters in a concise list:
- Name: The name of the App Service plan.
- Location: The Azure Region where the App Service will exist.
- OS Type: The operating system type, which can be Windows, Linux, or WindowsContainer.
- Resource Group Name: The name of the resource group that holds the App Service plan.
- SKU Name: The SKU for the plan, which determines the pricing and features.
App Service Plan Properties
App Service Plan Properties are crucial for setting up and configuring your App Service plan.
Broaden your view: Azure App Insights vs Azure Monitor
The App Service Plan Properties include properties such as elasticScaleEnabled, freeOfferExpirationTime, hostingEnvironmentProfile, and more. These properties allow you to customize the behavior and settings of your App Service plan.
Some important properties to note are elasticScaleEnabled, which enables ElasticScale for your App Service plan, and freeOfferExpirationTime, which specifies the time when the server farm free offer expires. Additionally, hostingEnvironmentProfile allows you to specify the App Service Environment to use for the App Service plan.
Here are some key properties and their descriptions:
Choosing the right properties for your App Service plan is crucial for its performance and functionality. By selecting the right properties, you can ensure that your App Service plan meets your needs and provides the best possible experience for your users.
Scaling and Limits
You can control the maximum allowed resources for your server farm in Azure. This includes the maximum disk size usage in MB, with a value of int.
The maximum allowed memory usage in MB is also configurable, with the same value type of int. This can be useful for preventing resource overloads.
Here are the specific limits you can set:
Site Limits
Site Limits are crucial to understand when it comes to scaling your site. They essentially set a cap on how much resources your site can use.
The maximum allowed disk size usage is set by the maxDiskSizeInMb parameter, which is an integer value. This means you can only use up to a certain amount of disk space before it hits the limit.
The maxMemoryInMb parameter sets the maximum allowed memory usage in MB. This is important to prevent your site from consuming too much memory and causing performance issues.
You should keep an eye on the maxPercentageCpu parameter, which sets the maximum allowed CPU usage percentage. This ensures that your site doesn't consume too much CPU power and cause problems for other sites on the same server.
Here are some key site limits to keep in mind:
Sku Capacity
Sku Capacity is a crucial aspect of scaling and limits in App Service plans.
The default number of workers for a plan is specified by the "default" parameter, which is an integer value.
There are also limits to how many workers you can scale up to, with the "maximum" parameter setting the upper limit.
Elastic workers have their own maximum capacity, set by the "elasticMaximum" parameter.
The "minimum" parameter sets the lowest number of workers you can have for a plan.
Here's a summary of the key parameters that affect Sku Capacity:
Functions, Scale, and Concurrency Triggers
Scaling and Limits are crucial aspects of any cloud-based system. One of the key factors to consider is concurrency, which refers to the number of requests that can be handled simultaneously.
The maximum number of concurrent HTTP trigger invocations per instance is determined by the "perInstanceConcurrency" setting, which is an integer value. This setting can be adjusted to suit specific needs.
Let's take a look at the specifics of this setting. The "perInstanceConcurrency" setting is used to control the maximum number of concurrent HTTP trigger invocations per instance.
Triggers and Automation
Triggers in Azure's Microsoft.Web.ServerFarms allow for automated actions based on specific conditions.
You can set up triggers based on private bytes, such as when private bytes exceed a certain threshold in KB.
There are multiple types of triggers, including rules based on total requests, request execution time, and status codes.
Here are some examples of triggers:
You can also set up triggers based on multiple slow requests with a specific path, and even status codes or ranges of status codes.
Triggers can be set up to automate actions based on these conditions, making it easier to monitor and manage your server farms.
ARM and Terraform Resources
To create a Microsoft.Web/serverfarms resource, you'll need to use Terraform. Terraform is a powerful tool for managing infrastructure as code.
The Terraform resource definition for Microsoft.Web/serverfarms includes several key properties. These properties include extendedLocation, kind, location, name, properties, sku, tags, and type.
The extendedLocation property is used to specify the extended location of the resource. This is a required property.
The kind property specifies the kind of resource. If the resource is an app, you can refer to the kind property reference for supported values.
The location property is the resource location, and it's a required property.
The name property is the resource name, and it's also a required property.
The properties property contains app service plan resource specific properties.
The sku property describes a SKU for a scalable resource.
The tags property contains resource tags, which are a dictionary of tag names and values.
The type property specifies the resource type, which is "Microsoft.Web/serverfarms@2024-04-01".
Here's a summary of the required properties:
Sources
- https://learn.microsoft.com/en-us/azure/templates/microsoft.web/sites
- https://shisho.dev/dojo/providers/azurerm/App_Service_Web_Apps/azurerm-service-plan/
- https://learn.microsoft.com/en-us/azure/templates/microsoft.web/serverfarms
- https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-web-serverfarms-metrics
- https://geoffhudik.com/tech/2017/12/01/exploring-azure-arm-templates-deploying-an-asp-net-core-web-app/
Featured Images: pexels.com