Skip to content

Use two or more App Service Plan instances#

Reliability · App Service · Rule · 2020_06 · Important

App Service Plan should use a minimum number of instances for failover.

Description#

App Service Plans provide a configurable number of instances that run apps. When a single instance is configured, your app may be temporarily unavailable during unplanned interruptions. In most circumstances, Azure will self-heal faulty App Service instances automatically. However, during this time there may be interruptions to your workload.

For higher resiliency in supported regions, App Service Plans can also use availability zones (zone redundancy). Zone redundancy distributes plan instances across physically separated zones and scales the plan to a minimum of three instances. See Azure.AppService.AvailabilityZone for zone-redundancy configuration. Use at least two instances for basic failover even when zone redundancy is not enabled.

This rule does not apply to consumption or elastic App Service Plans.

Recommendation#

Consider using an App Service Plan with at least two (2) instances. When you enable zone redundancy, plan for at least three (3) instances so the workload stays aligned with availability-zone guidance.

Examples#

Configure with Azure template#

To deploy App Service Plans that pass this rule:

  • Set sku.capacity to 2 or more.

For example:

Azure Template snippet
{
  "type": "Microsoft.Web/serverfarms",
  "apiVersion": "2022-09-01",
  "name": "[parameters('planName')]",
  "location": "[parameters('location')]",
  "sku": {
    "name": "P1v3",
    "tier": "PremiumV3",
    "size": "P1v3",
    "family": "Pv3",
    "capacity": 2
  }
}

Configure with Bicep#

To deploy App Service Plans that pass this rule:

  • Set sku.capacity to 2 or more.

For example:

Azure Bicep snippet
resource appPlan 'Microsoft.Web/serverfarms@2022-09-01' = {
  name: planName
  location: location
  sku: {
    name: 'P1v3'
    tier: 'PremiumV3'
    size: 'P1v3'
    family: 'Pv3'
    capacity: 2
  }
}

Configure with Azure Verified Modules

A pre-validated module supported by Microsoft is available from the Azure Bicep public registry. To reference the module, please use the following syntax:

br/public:avm/res/web/serverfarm:<version>

To use the latest version:

br/public:avm/res/web/serverfarm:0.7.0

Comments