Now that you have finished the migration and made your website live, it is a good idea to set up some sort of backup. There are many options but in this article, the procedure for setting up a simple Azure backup will be covered. For that, you will need a storage account.
Azure Storage Accounts
An Azure storage account isn’t just for backups and can be used to store all sorts of data types. The data stored within an Azure can also be replicated both locally – within the same datacentre – and geographically – between different datacentres – and it all costs money so select your options with care. Depending on your local data protection regulations regarding the storage of personal data, you may also be limited in your choice of locations for your storage account.
For the purposes of our little migration, our needs are simple:
- Set up a storage account
- Set up a backup of the files used by the DNN portal in Azure
- Set up a backup of the SQL database used by the DNN Portal in Azure
Once you have logged into your Azure account, create a new storage account and supply the following details:
- A name for the storage account – remember to use a naming convention as you will, in time, end up with several storage accounts. Azure is addictive.
- Select an Account kind. As we will be storing both files and a database backup, General Purpose will be most suitable.
- Select a replication option. As this is a backup then you don’t actually need a second copy but we have selected LRS (Locally Redundant storage) anyway.
- Select or create a resource group. As a resource group was created when we created the App Service, we can use it. That will keep all the components of this part of our new Azure empire together.
- Select a Location. As the App Service is in the UK, it makes sense to store the backup elsewhere in the world in case someone decides to torpedo the country. Europe is nearest and dear to our heart so the West Europe location was selected.
As you might imagine, the backup of ab Azure App service website has three parts:
- Website file backup
- Database backup
- Backup Schedule
The requirements of your application – in particular how quickly you would have to get it back following a failure – will determine how often you back up your website files and SQL databases. For this basic example, the source website files are backed up.
The database files are backed up to the same location. The databases are selected based on the connection string used. In this example, there is only one database and the default connection is used. Note that while data at rest is cheap in Azure, you get charged every time the data moves. If the destination for the backup is in a different Azure datacentre than the source, then frequent database backups, especially, can get expensive quickly.
The backup schedule can be set to your requirements. As this is a basic example, daily backups will suffice. Note the options to retain the backup – the more backups you retain the more they will cost you.
Once everything is set up, you should check if the backup has run correctly at its scheduled time.