How to Restore the Databases from Recovery service vault via Automation scripts

Thyagarajulu BM 20 Reputation points
2024-04-21T10:52:05.3666667+00:00

Hello Team,

Currently, we have implemented Azure backup policies to take database backups of SQL servers on Azure via recovery site vaults.

And also, I am able to restore the databases to the target system in the production subscription using Recovery Service Vault.

I didn't find an option to automate database restoration to the target system on the recovery service vaults.

Is it possible to Automate database restore To target system using RSA . If yes, could you please help us find suitable articles to take further action on it?

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,132 questions
0 comments No comments
{count} votes

Accepted answer
  1. hossein jalilian 3,015 Reputation points
    2024-04-21T21:22:39.13+00:00

    Hello Thyagarajulu BM,

    Thanks for posting your question in the Microsoft Q&A forum.

    You can achieve this by leveraging Azure Automation along with Azure PowerShell or Azure CLI scripts.

    1. Create an Azure Automation account in your Azure subscription if you haven't already.
    2. In Azure Automation, create runbooks to define the automation tasks.
    3. Inside your runbook, you'll need to import the AzureRM module to interact with Azure resources. You can install this module using the following command:
         Install-Module -Name Az -AllowClobber -Scope CurrentUser
      
    4. Write PowerShell or Python scripts within your runbook to restore the databases from the recovery service vault to the target system
    5. Schedule them to run at specified intervals or trigger them based on specific events.

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    0 comments No comments

0 additional answers

Sort by: Most helpful