Recently we were in a situation where we need to merge data from our offline version of application ...
Hosting providers unload your application after certain amount of time if the application is idle. ...
DateTime.Now returns the time by taking into account server’s time zone on which application ...
In this article we will see how to take Microsoft SQL Server database backup to Azure storage. At high level, we have to do the following to achieve this:
- Create storage account in Microsoft Azure
- Create container in Azure storage account
- Create SQL Server credential using information from Microsoft Azure storage account
- Taking backup using Microsoft SQL Server Management Studio
- Taking backup using SQL code
1. Create storage account in Microsoft Azure
Login to Azure Portal. Create a storage account. To add a storage account, click on the Storage accounts on left and then click on +Add option on top.
It will show the following options, fill in all the details but remember to select General purpose under Account kind, it is circled in the image, otherwise it will give error while taking backup.
2. Create container in Azure storage account
Once storage account is created, we need to create a Container which will keep the database backup files. To add a container, click on Storage accounts, all the storage accounts in your Azure account will be shown. Click on the newly created storage account to open its properties. Click on Containers then on +Container, give the name and click OK as shown in the image below:
3. Create SQL Server credential using information from Microsoft Azure storage account
Use the following SQL code to create credential to use while taking backup.
use master; CREATE CREDENTIAL AzureBlobStorageCredential...