Azure App Service Backups Failing

One solution to Website backups failing with “Timeout expired”

Symptoms

An Azure WebApp site was configured to backup using the built-in backup config. This had been working fine on a daily basis and then one day just started failing. Subsequent backups also failed indicating it was not a transient error, but other backups sharing the same tenant, region, and database server continued to back up successfully. The Website (running WordPress) itself was still live, indicating a successful connection to the Azure Database for MySQL server that was backing it.

The following error could be found in the Azure Activity logs for the App Service, and there was no indication that any changes had been made to the service at an Azure level since the last successful backup.

1CorrelationId: 
2Timestamp: 
3Creating temp folder.
4Retrieve site meta-data.
5Backing up the databases.
6  -- web-app-name
7Error in the backup operation: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

Cause

In this case the backup was failing because there is a 10GB limit attached to the built-in backup service. Whilst there was only 150MB of file content on the site, the database size had grown past this threshold. This native backup on the AppService was configured to include the default database which was causing it to fail.

Solution

Reconfiguring the backup to exclude the database enabled backups to successfully complete. The database can continue to be protected by using the its own backup service. This isn’t necessarily as convenient as using the AppService backup, but can scale beyond 10GB and offers the same or better protection.

Thanks to Suresh in the Microsoft Support team for his work helping to uncover this