Restore an app in Azure from a snapshot

This article shows you how to restore an app in Azure App Service from a snapshot. You can restore your app to a previous state, based on one of your app's snapshots. You do not need to enable snapshot backups; the platform automatically saves a hourly snapshot of each app's content and configuration for data recovery purposes. Hourly snapshots for the last 30 days are available. The retention period and snapshot frequency are not configurable.

Restoring from snapshots is available to apps running in one of the Standard or Premium tiers. For information about scaling up your app, see Scale up an app in Azure.

Note

Snapshot restore is not available for:

Snapshot restore is available in preview for Azure Functions in dedicated (App Service) Standard or Premium tiers.

Snapshots vs Backups

Snapshots are incremental shadow copies and offer several advantages over standard backups:

  • No file copy errors due to file locks.
  • Higher snapshot size (maximum 30 GB).
  • Enabled by default in supported pricing tiers and no configuration required.
  • Restore to a new or existing App Service app or slot in any Azure region.

What snapshot restore includes

The following table shows which content is restored when you restore a snapshot:

Settings Restored?
Windows apps: All app content under %HOME% directory
Linux apps: All app content under /home directory
Custom containers (Windows and Linux): Content in persistent storage
Yes
Content of the run-from-ZIP package No
Content from any custom mounted Azure storage No

Note

Maximum supported size for snapshot restore is 30GB. Snapshot restore fails if your storage size is greater than 30GB. To reduce your storage size, consider moving files like logs, images, audios, and videos to Azure Storage, for example.

The following table shows which app configuration is restored:

Settings Restored?
Native log settings, including the Azure Storage account and container settings Yes
Application Insights configuration Yes
Health check Yes
Network features, such as private endpoints, hybrid connections, and virtual network integration No
Authentication No
Managed identities No
Custom domains No
Scale out No
Diagnostics with Azure Monitor No
Alerts and Metrics No
Backup No
Associated deployment slots No
Any connected database that standard backup supports No

Restore from a snapshot

Note

App Service stops the target app or target slot while restoring a snapshot. To minimize downtime for the production app, restore the snapshot to a deployment slot first, then swap into production.

  1. On the Settings page of your app in the Azure portal, click Backups to display the Backups page. Then click Restore under the Snapshot section.

    Screenshot that shows how to restore an app from a snapshot.

  2. In the Restore page, select the snapshot to restore.

  3. Specify the destination for the app restore in Restore destination. To restore to a deployment slot, select Existing app.

    Note

    It's recommended that you restore to a deployment slot and then perform a swap into production. If you choose Overwrite, all existing data in your app's current file system is erased and overwritten. Before you click OK, make sure that it is what you want to do.

  4. You can choose to restore your site configuration.

    Screenshot that shows how to restore site configuration.

  5. Click OK.