Azure web app backups can fail for a variety of reasons. Recently, I had a web app fail for a reason I hadn’t seen before. I was certain that my backups were working correctly… nope. Not exactly. They actually hadn’t been working for some time. This time was different from the others – the deployed web app was too big.
Apparently, there’s a limit of the backup size (10GB) for web apps and the associated DBs if you are backing up in tandem (4GB individual limit for DBs), and this app was over that limit. Side note: if the database you are backing up is constantly growing – consider using a different method for backing up this data.
Upon further inspection of the web app, I saw that there were a lot of log and deployment files that didn’t need to be backed up, but that I didn’t necessarily want to delete in case I needed them.
There is an answer to this conundrum though: a _backup.filter file.
Simply create a file and save it as _backup.filter on your local drive.
In this file, list out the directories that you want to exclude from your backups (one on each line). Mine looks like this:
I’ve excluded 2 directories from my app, 1 contains the log files and 1 contains uploaded packages.
Once you’ve created this file, simply upload it to your web app in the wwwroot folder and voila!
Here’s a sample of the difference it makes it excluding large directories from your backups:
May the Cloudforce be with you!