'Azure REST API to recover Azure SQL Server
I am looking at Azure SQL Server & database DR options.
It appears that it is possible to recover a deleted Azure SQL Server: https://docs.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://docs.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?
Solution 1:[1]
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.
Solution 2:[2]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | UtkarshPal-MT |
| Solution 2 | AnuragSharma-MSFT |
