Last Update: Sep 04, 2024 | Published: Jan 29, 2018
In this post, I will show you how to backup Web apps that are hosted as an Azure App Service in an App Service Plan.
An App Service or Web app might run in PaaS but your requirements to protect it are probably no different than they would be if it was running in a virtual machine. This is why it is possible, using the Standard and Premium App Service Plan tiers only, to backup your Web apps. The following kinds of data can be protected:
Note that the following database types are supported:
There are three requirements to back up a web app:
The first step for enabling backups is to create a storage account. If you want to use blob tiering (this would require a bit of effort), then you could use a General Purpose v2 (GPv2) storage account. However, if you do not need blob tiering, I would recommend a General Purpose v1 (GPv1) storage account because of the much lower storage transaction charges (often almost unnoticeable in the bill).
With the storage account ready, you can configure backs up in the web app or App Service. Open the App Service that you want to protect in the Azure Portal and browse to Settings > Backups. Click Configure and a Backup Configuration blade should appear:
It will take a few minutes for the backup to be configured. After that, any scheduled backups will run automatically but you also have the option to run a manual backup.
You can return to Settings > Backup in the web app to see the status of backups. You also can click the Backup button to manually trigger a backup.
You can see the backup data in the storage account. Open the storage account in the Azure Portal or a tool, such as Azure Storage Explorer and browse to Blobs. Then go into the container (folder) that you created to store the web app’s backups in.
Here you will see three files that contain time stamps in their names:
You can download the zip file from the storage account but you are also given a link for each retained backup in the Backup configuration of the web app.
It is possible to exclude files from your backups, which might be important to you if your backup size exceeds 10GB.
Tip: Azure SQL does its own backups automatically and for free. You can choose to exclude any databases to save capacity.
If you have web content that you wish to exclude from backups then you can do the following:
The web app backup will automatically read the _backup.filter file and exclude any listed files or folders from protection.
What good is a backup if you cannot restore it? A Restore button can be found in the Backup configuration of the web app or App Service; press this button and you can start the restore process. Here you can select the backup to restore (or provide a zip file from another App Service or web app), choose to restore to a different App Service or Web App, and decide how you will handle database connection strings and any conflicting host names.