Reliability in Azure App Service Environment

App Service Environment is an Azure App Service feature that provides a fully isolated and dedicated environment to run App Service apps securely at high scale. As an Azure service, App Service Environment provides a range of capabilities to support your reliability requirements.

When you use Azure, reliability is a shared responsibility. Microsoft provides a range of capabilities to support resiliency and recovery. You're responsible for understanding how those capabilities work within all of the services you use, and selecting the capabilities you need to meet your business objectives and uptime goals.

This article describes reliability support in App Service Environment, including resilience to transient faults, availability zone failures, and region-wide failures. It also describes backup and restore capabilities, resilience to service maintenance, and key information about the App Service Environment service-level agreement (SLA).

Note

Unlike the App Service public multitenant offering that shares supporting infrastructure, an App Service Environment provides dedicated compute resources and enhanced network isolation for a single customer.

For more information about reliability support in the public multitenant App Service, see Reliability in App Service.

Production deployment recommendations for reliability

For production workloads, we recommend that you:

Reliability architecture overview

This section describes how the service's architecture supports reliability. It introduces the logical architecture, including the resources and features that you deploy and use, and the physical architecture, including the underlying infrastructure that runs the service.

Logical architecture

An App Service Environment is a regional resource that contains your App Service plans and apps. You deploy it into a dedicated subnet in your virtual network. You configure the network access controls and choose whether to enable zone redundancy on the environment and its plans. The subnet's available IP addresses affect the environment's ability to scale. For more information, see App Service Environment networking.

Within the environment, you create one or more App Service plans. An App Service plan defines a set of compute resources that run your web apps. All web apps must run inside a plan. You can scale a plan to run on multiple Virtual Machine (VM) instances, also called workers. These instances provide the compute resources that run your app code. A single App Service plan can host multiple apps. All apps run on the same shared set of VM instances.

Plans in an App Service Environment use the Isolated v2 or Isolated v4 pricing tier. Isolated v4 is available only in supported regions and environment deployments. Its capacity constraints can affect deployment and scale-out operations.

You deploy your application code and configure its settings in an app. You can also use a deployment slot, which is a live app with its own hostname, to test changes before swapping them into production. You're responsible for your app code, configuration, dependencies, and the number of instances in each plan. For more information, see Deployment slots.

Physical architecture

Microsoft manages the environment's underlying infrastructure, including the VM instances that run your apps and the front ends that receive application traffic and route it to those instances. The environment also provides dedicated remote file storage for app content. These supporting components are dedicated to your environment and not shared with other customers. Microsoft monitors and scales the supporting infrastructure as needed. For more information, see App Service Environment and multitenant App Service comparison and Monitor the App Service Environment.

App Service provides the following redundancy features:

  • Distribution across fault domains: At the platform level, Azure automatically distributes your App Service plan's VM instances across fault domains within the Azure region. This distribution minimizes the risk of localized hardware failures by grouping VMs that share a common power source and network switch.

  • Distribution across availability zones: If you enable zone redundancy on a supported App Service plan, Azure distributes your instances across availability zones within the region. This configuration provides higher resiliency if a zone outage occurs. For more information about zone redundancy, see Availability zone support.

  • App scaling: When you configure your App Service plan to run multiple VM instances, all apps in the plan run on all instances by default. If you configure your plan for autoscaling, all apps scale out together based on the autoscale settings. However, you can customize how many plan instances run a specific app by using per-app scaling.

  • Scale units: Internally, App Service runs on a platform infrastructure called scale units, also known as stamps or webspaces. A scale unit includes all components needed to host and run App Service, including compute, storage, networking, and load balancing. Azure manages scale units to ensure balanced workload distribution, perform routine maintenance, and maintain overall platform reliability.

    Some capabilities might only be applied to specific scale units. For example, some App Service scale units might support zone redundancy, while other scale units in the same region don't.

  • Dedicated hosts: For hardware-level isolation, you can deploy an environment on dedicated hosts, which are physical servers reserved for your environment. Dedicated-host deployments aren't zone redundant, are available in limited regions, and support specific plan types. The available host cores limit capacity across both your plans and the supporting infrastructure. For more information, see Dedicated environment.

The data plane serves application traffic. The control plane handles resource management, such as plan scaling, app creation, and configuration. A failure can affect these operations differently. These operations, along with application publishing, are nonruntime behaviors. Failures can affect runtime and nonruntime behaviors differently. For example, during a zone outage, apps in a zone-redundant plan can continue to serve traffic while nonruntime operations are affected. For more information, see Behavior during a zone failure.

Resilience to transient faults

Transient faults are short, intermittent failures in components. They occur frequently in a distributed environment like the cloud, and they're a normal part of operations. Transient faults correct themselves after a short period of time. It's important that your applications can handle transient faults, usually by retrying affected requests.

All cloud-hosted applications should follow the Azure transient fault handling guidance when they communicate with any cloud-hosted APIs, databases, and other components. For more information, see Recommendations for handling transient faults.

Microsoft-provided SDKs usually handle transient faults. Because you host your own applications on App Service, take steps to reduce the chance of transient faults:

  • Deploy multiple instances in your plan. App Service performs automated updates and other forms of maintenance on instances in your plan. If an instance becomes unhealthy, the service can automatically replace that instance with a new healthy instance. During the replacement process, there can be a short period when the previous instance is unavailable and a new instance isn't ready to serve traffic. To mitigate these effects, deploy multiple instances of your App Service plan.

  • Use deployment slots. App Service deployment slots enable zero-downtime deployments of your applications. Use deployment slots to minimize the effect of deployments and configuration changes for your users. Deployment slots also reduce the likelihood that your application restarts. Restarting the application causes a transient fault.

  • Avoid scaling up or scaling down. These operations change the CPU, memory, and other resources assigned to each instance, and they can trigger an application restart. Instead, select a tier and instance size that meet your performance requirements under typical load. To scale out and scale in, dynamically add and remove instances to handle changes in traffic volume.

Account for per-app scaling. Multiple instances in your plan help maintain availability only when your app can run on multiple instances. If you use per-app scaling, review the worker limit for each app and deployment slot. A limit of one permits only one active instance, even when the plan has multiple instances. Higher limits allow multiple active instances, but the actual number depends on available plan workers and platform placement.

Handle faults in your applications and clients. Dedicated infrastructure doesn't eliminate transient faults. You're responsible for handling faults in calls from your apps to dependent services and in clients that call your apps. Retry failed requests only when it's safe to repeat the operation, and account for the possibility of duplicate processing.

Resilience to availability zone failures

Availability zones are physically separate groups of datacenters within an Azure region. When one zone fails, services can fail over to one of the remaining zones.

You can configure your App Service Environment as zone redundant. Then, enable zone redundancy on each App Service plan that needs it. Azure automatically selects the zones and distributes the plan's instances across at least two availability zones.

Each plan has an independent zone redundancy setting. You can use a mix of zone-redundant and nonzonal plans in the same environment. Enabling zone redundancy on the environment alone doesn't make every plan zone redundant. For more information, see Instance distribution across zones.

The following diagram shows an example environment that uses three availability zones and a plan with two instances.

Diagram of an example zone-redundant App Service Environment with two plan instances in different zones.

In this example, an App Service Environment and its App Service plan can use Availability Zones 1, 2, and 3. The plan has two instances, one in Availability Zone 1 and one in Availability Zone 2. No instance is shown in Availability Zone 3. The diagram doesn't imply that every region has exactly three zones or that every plan can use all zones in its region.

If you don't configure a plan as zone redundant, it's nonzonal. Its underlying VM instances don't have guaranteed distribution across availability zones, and the apps can experience downtime during a zone outage.

Requirements

To enable zone redundancy for your App Service Environment, you must meet the following requirements:

  • Region support: For Isolated v2 plans, see the availability zone support column in App Service Environment regions.

    For Isolated v4 plans, use the regions specifically marked as supporting availability zones in Isolated v4 regions. Isolated v4 availability in a region doesn't by itself establish zone redundancy support.

  • Plan type: Use Isolated v2 or Isolated v4 plans in a supported environment deployment.

  • Dedicated hosts: Environments deployed on dedicated hosts don't support zone redundancy.

  • Minimum number of instances: Deploy a minimum of two instances in your plan for it to be zone-redundant.

    Nonzonal plans in your environment can be deployed with a single instance.

  • Scale unit: Your environment must be deployed to a scale unit that supports availability zones. You don't directly control the scale unit that your environment uses. Instead, when you create an App Service environment, the environment is assigned to a scale unit based on the environment's resource group. To determine whether the scale unit for your App Service Environment supports zone redundancy, Check for zone redundancy support for an App Service Environment.

    If your environment is on a scale unit that doesn't support availability zones, you can't enable zone redundancy on your environment or plans. Instead, you need to create a new environment in a new resource group, and redeploy your apps to new plans within that environment.

  • Configuration requirements: Enable zone redundancy on both the environment and each plan that needs zone redundancy. You can enable it during creation or by updating existing supported resources.

Considerations

Consider the following factors when you design a zone-resilient workload:

  • Per-app scaling: Zone redundancy distributes plan instances, not guaranteed replicas of each app. If you use per-app scaling, an app or deployment slot with a worker limit of one can use only one active instance. A higher limit allows multiple active instances but doesn't guarantee that they span physical zones. For more information, see Resilience to transient faults.

  • Nonruntime behaviors: An availability zone outage might affect some aspects of App Service, even though the application continues to serve traffic. These behaviors include App Service plan scaling, application creation, application configuration, and application publishing.

  • Platform updates: When you enable zone redundancy on your App Service plan, you also improve resiliency during platform updates. For more information, see Resilience to service maintenance.

Instance distribution across zones

When you create a zone-redundant App Service plan, Azure distributes the plan's instances across availability zones in the region. App availability during a zone outage depends on the app's active instance placement and remaining capacity. With per-app scaling, plan-level zone redundancy doesn't guarantee that each app or deployment slot has active instances in multiple zones.

Instance distribution in a zone-redundant deployment follows specific rules. These rules also apply as the app scales in and out:

  • Minimum instances: Your App Service plan must have a minimum of two instances for zone redundancy.

  • Maximum availability zones supported by your plan: Azure determines the number of availability zones that your plan can use, which is referred to as maximumNumberOfZones. To view the number of availability zones that your specific plan can use, see Check zone redundancy support for an App Service plan.

    Note

    The number of availability zones available to your plan (maximumNumberOfZones) varies by scale unit and region. A zone-redundant deployment always uses at least two availability zones, and might use more depending on your scale unit. Regardless of the number of zones, a zone-redundant deployment provides resilience to a single zone failure and offers the same SLA.

  • Instance distribution: When zone redundancy is enabled, Azure distributes plan instances across multiple availability zones automatically. The distribution is based on the following rules:

    • If the number of instances exceeds maximumNumberOfZones and divides evenly, Azure distributes the instances evenly across zones.

    • If the number of instances doesn't divide evenly, Azure distributes the remaining instances across the remaining zones.

    • When the App Service platform allocates instances for a zone-redundant App Service plan, it uses best-effort zone balancing that the underlying Azure virtual machine scale sets provide. A plan is balanced if each zone has the same number of VMs or differs by one instance from all other zones. For more information, see Zone balancing.

  • Physical zone placement: You can view the physical availability zone used for each of your App Service plan instances. For more information, see View physical zones for an App Service plan.

For environment-level zone support, see Check for zone redundancy support for an App Service Environment. To inspect the physical zones of an app's currently active instances, see View physical zones for an App Service plan. These observations don't guarantee future placement or cross-zone replicas for an app that uses per-app scaling.

Cost

Enabling zone redundancy doesn't add a separate charge. There's no extra meter for the zone redundancy feature itself, and the per-instance price for a zone-redundant plan is the same as for a single-zone plan. However, enabling zone redundancy increases the minimum number of instances your plan must run, which can increase your bill.

If you enable availability zones but specify a capacity of less than two, the platform enforces a minimum instance count of two. The platform charges you for those two instances.

Important

When you enable availability zones for an App Service Environment, the platform scales all App Service plans with fewer than three instances to have three instances, which is the recommended configuration. Any plan with three or more instances remains unchanged.

After the operation completes, you can choose to manually scale a zone-redundant plan to two instances. This configuration is supported, but we recommend retaining at least three instances. Disable zone redundancy on a plan before scaling it below two instances.

Charges are based on your App Service plan SKU, the capacity that you specify, and any instances that you scale to based on your autoscale criteria. For more information, see Azure App Service on Linux pricing and Azure App Service on Windows pricing.

Configure availability zone support

To learn how to create, enable, or disable a new zone-redundant App Service Environment and new zone-redundant App Service plans, see Configure App Service Environments and Isolated v2 App Service plans for zone redundancy.

Note

A change in the zone redundancy status of an App Service Environment takes 12 to 24 hours to complete. During the upgrade process, no downtime or performance problems occur.

For an example zone-redundant architecture, see High availability enterprise deployment that uses App Service Environment.

Capacity planning and management

To prepare for availability zone failure, consider over-provisioning the capacity of your App Service plan. This approach allows the solution to tolerate some capacity loss and continue to function without degraded performance. For more information, see Manage capacity by using over-provisioning.

The following constraints also affect your environment's capacity:

  • Subnet addresses: Reserve subnet IP addresses based on the number of plan instances, supporting infrastructure, scaling, and upgrades. Insufficient addresses can block plan or infrastructure scaling. For more information, see Subnet requirements.

  • Isolated v4 capacity: Large scale-outs might fail without pre-provisioned subscription capacity. For more information, see Scaling out an Isolated v4 plan.

Behavior when all zones are healthy

The following list describes what to expect when an App Service environment and its plans are configured for zone redundancy and all availability zones are operational:

  • Traffic routing between zones: During normal operations, traffic is routed between all available App Service plan instances across all availability zones.

  • Data replication between zones: App Service synchronously replicates persistent app content on the environment's shared file storage between availability zones by using zone-redundant storage.

Behavior during a zone failure

The following list describes what to expect when an App Service Environment and its plans are configured for zone redundancy and one availability zone is unavailable:

  • Detection and response: The App Service platform automatically detects failures in an availability zone and initiates a response. No manual intervention is required to initiate a zone failover.
  • Notification: Microsoft doesn't automatically notify you when a zone is down. However, you can use Azure Resource Health to monitor the health of an individual resource, and you can set up Resource Health alerts to notify you of problems. You can also use Azure Service Health to understand the overall health of the service, including any zone failures, and you can set up Service Health alerts to notify you of problems.
  • Active requests: Any in-progress requests that connect to an App Service plan instance in the faulty availability zone are terminated. Clients can follow transient fault handling practices to retry the request using a healthy instance.

  • Expected data loss: No data loss is expected for persistent app content stored in the environment's zone-redundant storage. Temporary local files and in-memory state on affected instances can be lost. Data-loss behavior for external dependencies depends on those services.

  • Expected downtime: In most situations, minimal downtime of a few seconds is expected during a zone failure to allow time for load balancers to redirect traffic to healthy instances. Applications in a zone-redundant App Service plan continue to run and serve traffic even if an availability zone experiences an outage.

    An availability zone outage might affect some aspects of App Service, even though the application continues to serve traffic. These behaviors include App Service plan scaling, application creation, application configuration, and application publishing.

    Apps and deployment slots that per-app scaling limits to one active instance have no simultaneous replica to serve requests if that instance's zone fails. Recovery depends on starting a replacement app replica on available plan capacity, which isn't guaranteed to succeed. For more information, see Per-app scaling considerations.

  • Redistribution: App Service detects the lost instances from that zone and attempts to find new replacement instances. After App Service finds replacements, it distributes traffic across the new instances as needed.

    If autoscale is configured and determines that more instances are needed, it requests instances from App Service. Autoscale behavior operates independently of App Service platform behavior, which means that your instance count specification doesn't need to be a multiple of two. For more information, see Scale up an app in App Service and Autoscale overview.

    Important

    Azure doesn't guarantee that requests for more instances succeed in a zone-down scenario. The platform attempts to backfill lost instances on a best-effort basis. If you need guaranteed capacity during an availability zone failure, create and configure your App Service plans to account for zone loss by over-provisioning the capacity.

Zone recovery

When the availability zone recovers, App Service automatically creates instances in the recovered availability zone, removes any temporary instances created in the other availability zones, and routes traffic between your instances as usual.

Test for zone failures

The App Service platform manages traffic routing, failover, and failback for zone-redundant App Service environments and plans. This feature is fully managed, so you don't need to initiate or validate availability zone failure processes.

Resilience to region-wide failures

App Service Environment is a regional service and doesn't provide built-in cross-region replication or failover. If the region becomes unavailable, your environment and its plans and apps also become unavailable. For backup-based recovery, see Backup and restore.

Custom multiregion solutions for resiliency

You can deploy your application to separate App Service Environments in multiple regions. You're responsible for maintaining the regional deployments, configuring traffic routing and failover, and managing cross-region replication for application data and dependencies.

For architecture options and their tradeoffs, see Multiple-region architectures for Azure App Service disaster recovery, which covers both App Service and App Service Environment.

Backup and restore

Use App Service backup and restore to recover apps when code is difficult to redeploy or app state is stored on disk.

Backups complement the other resiliency capabilities in this guide but don't replace them. Automatic backups can restore apps only within the same App Service Environment and don't protect against a regional outage. Custom backups can restore apps into another environment, including one in another region, if the backup storage remains accessible.

Important

Starting March 31, 2028, Azure App Service custom backups will no longer support backing up linked databases. See Deprecation of linked database backups for more information. Instead, use the native backup and restore tools of your linked database.

For more information, see Back up and restore your app in Azure App Service.

Resilience to accidental deletion

App Service retains deleted apps in paid plans for 30 days. You can restore a deleted app's content and supported configuration, but only if its App Service Environment still exists. After 30 days, App Service purges the deleted app and you can't restore it through this capability.

You're responsible for initiating recovery through the Azure portal or Azure PowerShell. Recovery overwrites the target app's content and, if selected, configuration. Custom domains, bindings, and certificates aren't restored, so you need to reconfigure them. This capability doesn't replace backups.

For recovery requirements and instructions, see Restore a deleted app in App Service.

Resilience to service maintenance

App Service performs regular service upgrades and other maintenance tasks. To maintain your expected capacity during an upgrade, the platform automatically adds extra instances of the App Service plan during the upgrade process.

  • Enable zone redundancy. When you enable zone redundancy on your App Service Environment and plans, you also improve resiliency during platform updates. Update domains consist of collections of VMs that go offline during an update, and they map to availability zones. Deploying multiple instances in each App Service plan and enabling zone redundancy for your plan adds an extra layer of resiliency if an instance or zone becomes unhealthy during an upgrade.

  • Prepare for app restarts. App processes can restart during maintenance. You're responsible for ensuring that your apps start reliably and handle interrupted requests and connections. For more information, see Resilience to transient faults and Routine maintenance for App Service, restarts, and downtime.

  • Customize the upgrade cycle. You can choose automatic upgrades with an early, default, or late preference, or initiate upgrades manually. Manual upgrades let you validate an upgrade in a nonproduction environment before applying it to production. You typically have 15 days to initiate an available upgrade before Microsoft applies it automatically. The notice period can be shorter, and a security hotfix can supersede a manual upgrade. For configuration instructions and exceptions to the manual upgrade window, see Set upgrade preference for App Service Environment planned maintenance.

  • Monitor upgrade notifications. Microsoft publishes available upgrades in Service Health. You can configure alerts and send a test notification to validate your notification and automation setup. After an upgrade starts, it runs until completion and doesn't pause during business hours.

Service-level agreement

The service-level agreement (SLA) for Azure services describes the expected availability of each service and the conditions that your solution must meet to achieve that availability expectation. For more information, see SLAs for online services.

When you deploy a zone-redundant App Service plan, the uptime percentage defined in the SLA increases. The same SLA applies regardless of the number of zones available on the underlying scale unit.