Cross subscription Azure SQL VM database restore using Azure CLI

Nikhil Verma 40 Reputation points
2024-10-14T08:16:53.7466667+00:00

Hi , Anyone tried restoring sql database running on Azure SQL VM and backed up via Azure Backup . Via recovery vault , we are able to perform the cross subscription restore but not using the Azure CLI .

User's image

All desired permissions in place as documented by MS..

Getting below error :

User's image

SQL Server on Azure Virtual Machines
Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,268 questions
Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Mahesh Kurva 245 Reputation points Microsoft Vendor
    2024-10-15T11:32:28.2666667+00:00

    Hi @Nikhil Verma,

    Any precise Az CLI command example can be shared which I can try in our environment?

    Here’s an example of a precise Azure CLI command for cross-subscription restore:

    az backup recoveryconfig show --resource-group <source-resource-group> --vault-name <vault-name> --container-name <container-name> --item-name <item-name> --restore-mode AlternateWorkloadRestore --rp-name <restore-point-name> --target-container-name <target-container-name> --target-item-name <target-item-name> --target-resource-group <target-resource-group> --target-server-name <target-server-name> --target-server-type SQLInstance --target-subscription-id <target-subscription-id> --target-vault-name <target-vault-name> --workload-type SQLDataBase
    

    Running the command with the --debug flag can provide more detailed error messages, which might help you identify the issue. To do this, simply add the --debug flag to the end of your command:

    az backup recoveryconfig show --resource-group <resource_group_name> --vault-name <vault_name> ... --debug
    

    For more information, please refer the document: Cross Subscription Restore.

    Hope this helps. Do let us know if you any further queries.If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.