Azure REST API to recover Azure SQL Server

142 Views Asked by At

I am looking at Azure SQL Server & database DR options.

It appears that it is possible to recover a deleted Azure SQL Server: https://learn.microsoft.com/en-us/rest/api/sql/2021-08-01-preview/deleted-servers/recover

Firstly, I can successfully list existing Azure SQL Servers:

az login -t "xxxxxx-xxxx-xxxxx-xxxx-xxxxxxx"

az rest -m get -u 'https://management.azure.com/subscriptions/yyyyyyy-yyyyyyyy-yyyy-yyyy-yyyyyy/providers/Microsoft.Sql/servers?api-version=2021-11-01-preview'

(reference: https://learn.microsoft.com/en-us/rest/api/sql/2021-11-01-preview/servers/list)

However the recovery api is not working for me.

az rest -m post -u 'https://management.azure.com/subscriptions/yyyyyyy-yyyyyyyy-yyyy-yyyy-yyyyyy/providers/Microsoft.Sql/locations/eastus/deletedServers/testsvrxxxx/recover?api-version=2014-04-01-preview'

Any thoughts on how I can get this to work?

2

There are 2 best solutions below

0
AnuragSharma-MSFT On BEST ANSWER

Recover Deleted Server through these REST APIs are not supported and these will be removed from documentation in coming days as discussed internally with product team.

As of now Azure SQL Server recovery is possible only through the Support Request, and that too within 7 days of deletion of Server.

0
Utkarsh Pal On

Generally Azure only allows to recover the databases from backup file stored in Azure Blob Storage or local machine.

You can try with api-version=2021-08-01-preview in your request. If it works well in good otherwise I suggest you to raise a Support Request seeking help to recover deleted Server.