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:

  1. Open PowerShell ISE as administrator.
  2. Import the SQLPS module as follows:
    #import SQL Server module
    Import-Module SQLPS -DisableNameChecking
  3. Add the following script and run:
    $AzureStorageAccount = "replaceThisWithAzureStorageAccount" $credentialName = "AzureCredential" #replace values specific to your Azure account ...

Get SQL Server 2014 with PowerShell v5 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.