Restoring database from Azure Blob storage
This recipe walks you through how to restore a database to a local instance from a backup stored in Azure.
Getting ready
For this recipe, you need to have already performed a backup to Azure Blob storage. If you haven't already done so, you can refer to the recipe Backing up database to Azure Blob storage to prepare your environment.
How to do it...
These are the steps to change the recovery model:
Open PowerShell ISE as administrator.
Import the
SQLPS
module as follows:#import SQL Server module Import-Module SQLPS -DisableNameChecking
Add the following script and run:
$AzureStorageAccount = "replaceThisWithAzureStorageAccount" $credentialName = "AzureCredential" #replace values specific to your Azure account $blobContainer = "replaceWithYourContainerName" $backupUrlContainer = "https://$AzureStorageAccount.blob.core.windows.net/$blobContainer/" $backupfile = "replacethiswithyourazurefilename.bak" $backupfileURL = $backupUrlContainer + $backupfile ...