Azure Backup Web App for Disaster Recovery

Author

Reads 328

Man hacker concept
Credit: pexels.com, Man hacker concept

Azure Backup Web App is a powerful tool for disaster recovery, allowing you to protect your web applications and ensure business continuity.

With Azure Backup Web App, you can back up your web application's code, configuration files, and databases to a safe location, such as Azure Blob Storage or Azure File Storage.

This means you can quickly recover your web application in case of a disaster, such as a server crash or data loss.

You can also use Azure Backup Web App to automate your backups, so you don't have to worry about manual backups and potential data loss.

Azure Backup Web App supports multiple backup storage options, including Azure Blob Storage and Azure File Storage, which provide scalable and durable storage for your backups.

Backup vs. Recovery

Backup and recovery are two related but distinct concepts when it comes to protecting your data and applications.

Backup is primarily focused on data and application recovery, aiming to restore your systems after a data loss or corruption.

Detailed view of a black data storage unit highlighting modern technology and data management.
Credit: pexels.com, Detailed view of a black data storage unit highlighting modern technology and data management.

Restoring a database from backup is a common example of this process.

Recovery, on the other hand, is more about business continuity during disasters, ensuring your operations remain intact even when faced with a major outage.

Switching to a backup data center is a key part of this process, as it allows you to maintain business as usual.

Here's a quick comparison of backup and recovery:

In general, backup relies on regular backups to ensure data redundancy, whereas recovery involves redundant systems or centers to maintain business continuity.

Creating a Backup

To create a custom backup in Azure, you can use the Azure portal. On your app management page, select Backups from the left menu.

To initiate an on-demand backup at any time, select Configure on the Backups page. This will allow you to back up your linked databases.

Select Storage account and Container to configure your storage settings. You can either select an existing storage account or create a new one. Do the same for Container.

Mother protecting eyes of children against digital content
Credit: pexels.com, Mother protecting eyes of children against digital content

You can include database backups by selecting Next: Advanced > Include database on the Backups page. Be aware that for a supported database to appear in this list, its connection string must exist in the Connection strings section of the Configuration page for your app.

To initiate the backup, select Backup Now at the top of the Backups page. Your custom backup will be displayed in the list with a progress indicator.

Here are the steps to create a custom backup in Azure:

  1. Configure Backup Settings: Define backup schedules, retention policies, and other backup settings as needed.
  2. Initiate the Backup: Depending on the Azure service, you may need to initiate the backup manually, or it may run automatically according to the configured schedule.

Backup Configuration

Backup Configuration is a crucial step in ensuring your Azure Web App is protected against data loss. You can configure custom scheduled backups by selecting the "Set schedule" option on the Configure custom backups page.

Automatic backups are created for your app regularly as long as it's in a supported pricing tier, but custom backups require initial configuration and can be made on-demand or on a schedule. Custom backups are supported for Azure App Service, but not for automatic backups.

Here's an interesting read: Azure Configuration Management

Credit: youtube.com, How to configure backup of app deployed on Azure app service

To configure custom backups, you need to select the components or content to include or exclude from the backup. This can be done while configuring custom backups for your app. You can also create a custom backup by selecting an existing storage account or creating a new one, and then initiating an on-demand backup at any time.

Here are the key differences between automatic and custom backups:

Custom backups also support partial backups, which can be useful when you want to exclude certain portions of your app from the backup process.

Configure Backup Configuration

To configure backup configuration, you need to create a Recovery Services Vault in the Azure portal. This vault is used to store backup data. You can create a new vault or select an existing one.

Automatic backups are created for your app regularly as long as it's in a supported pricing tier. However, custom backups require initial configuration and can be made on-demand or on a schedule.

Credit: youtube.com, Azure Backup and Recovery Step by Step Demo | VM Backup Tutorial

To configure custom backups, you need to define backup schedules, retention policies, and other backup settings as needed. This includes specifying how often backups should occur, how long they should be retained, and any encryption or access control requirements.

You can back up to a firewall-protected storage account if it's part of the same virtual network topology as your app. To do this, you need to select the "Backup/restore over virtual network integration" checkbox when configuring custom backups.

Here's a comparison of automatic and custom backups:

You can automate backup management with scripts by using Azure CLI or Azure PowerShell. This can help streamline management and maintenance of your resources.

To configure partial backups, you need to create a _backup.filter file in the %HOME%\site\wwwroot folder of your app. Specify the list of files and folders you want to exclude in this file.

For more insights, see: Management Group Hierarchy Azure

Kudu API Download

You can download a full backup of your Azure App Service using the Kudu API. This can be done by accessing the Kudu interface within your App Service and getting a full download.

Credit: youtube.com, Azure App Service Advanced Tools a.k.a. Kudu

To access the Kudu interface, navigate to your App Service and look for the "Advanced Tools" option. From there, you can access the Kudu API and download a full backup of your site.

If you want to do this programmatically or via a command line, you can use the publish profile credentials to format a URL for a single-file download. This can be a convenient option if you need to automate the backup process.

The URL for the single-file download will look something like the one mentioned in the Kudu API Download section. You can use this URL to download a full backup of your site.

Broaden your view: Azure Api Version

Backup Methods

Snapshots are a feature in Azure that allows for automatic backups of your web app with no storage limits, configuration needed, or file copy issues due to file locks. This feature is currently in Preview, but it operates differently than the Backups functionality and provides additional benefits.

Credit: youtube.com, HOW TO RESTORE BACK UP IN AZURE APP SERVICE

You can take a snapshot of your entire web app, but you cannot restore a single file, and only 30 days of history is available. Additionally, you must restore the entire application, and it does not backup the database at the same time.

If you need more control over your backups, you can use the KUDU API to download your web app, or use the Powershell window to Zip the site and then download via FTP.

Snapshots

Snapshots are a feature in Azure that's been in Preview for over 2 years, but they're still not fully released. They offer a different set of benefits and limitations compared to Backups.

Snapshots have several advantages, including no website storage limits, automatic implementation, no file copy issues due to file locks, and more granular restore options for time.

Here are some key benefits of Snapshots:

  • No website storage limits
  • No configuration is needed, automatically implemented
  • No file copy issues due to file locks
  • Implementing using Shadow Copies so more granular restore options for time are available
  • Internally 90 days of backups are retained, for Azure Platform recovery purposes

However, Snapshots also have some limitations. For example, they're only available on the Premium tier of AppService, and you can only restore the entire application, not individual files.

PowerShell Zip & FTP Download

Credit: youtube.com, Backup FTP with Powershell (PoC)

To backup your Azure Web App, you can use the KUDU PowerShell window to zip the site and then download it via FTP. This process is quite easy, but you need to be aware of a few nuances.

The first step is to access the PowerShell Debug Console and navigate into the /site folder. The KUDU console does not support progress bars, so you must set the progress preference to silentlycontinue; otherwise, the entire process will fail.

To create a backup file called Mitch-Backup.zip in the current directory of the entire site, you can execute the following command: Add-Type -AssemblyName System.IO.Compression; [io.compression.zipfile]::CreateArchive("Mitch-Backup.zip", (Get-ChildItem -Path ".\" -Recurse -Force)). To get analytic information on how long it took to complete, you can wrap the command with a measure-command.

This method allows you to download the entire site as a single file, which can be much faster than grabbing individual files.

For more insights, see: Azure Ad Console

Multiple Files

You can upload multiple files at once by customizing the script to use Get-ChildItem to retrieve each item within a folder.

Credit: youtube.com, How to copy large amounts of files in Windows

To do this, you'll need to add a new parameter that takes the local directory path. This allows the script to access all the files in the folder.

Just load the script into memory and run it, and you'll be able to upload all the files in the folder with ease.

Curious to learn more? Check out: Azure Files Backup

Backup Limitations

Automatic backups can't be restored if the backup size exceeds the maximum size, which is 10 GB. This means you'll need to take extra steps to manage your storage size.

Custom backups fail if the maximum backup size or the maximum database size (4 GB) is exceeded. Be mindful of your database size to avoid backup failures.

File lock issues can prevent specific files from backing up. This can cause frustration if you're not aware of the issue.

Here are some common reasons why your linked database might not be backed up:

  • Backup of TLS-enabled Azure Database for MySQL isn't supported.
  • Backup of TLS-enabled Azure Database for PostgreSQL isn't supported.
  • In-app MySQL databases are automatically backed up without any configuration.

If you're using in-app MySQL databases, be aware that manual settings can cause backup issues. It's essential to review automatic failures to ensure your backups are working correctly.

Frequently Asked Questions

What is partially succeeded backup Azure Web App?

A "partially succeeded" backup of an Azure Web App means that some files were skipped during the backup due to a lock or sharing issue, causing the backup to end prematurely. This status indicates that not all data was successfully backed up.

What is the difference between backup and snapshot in Azure App Service?

In Azure App Service, a backup is for disaster recovery, while a snapshot is for tracking changes and reverting to a previous state. Understanding the difference helps ensure business continuity and efficient troubleshooting.

Katrina Sanford

Writer

Katrina Sanford is a seasoned writer with a knack for crafting compelling content on a wide range of topics. Her expertise spans the realm of important issues, where she delves into thought-provoking subjects that resonate with readers. Her ability to distill complex concepts into engaging narratives has earned her a reputation as a versatile and reliable writer.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.