Restore a accidentally deleted Azure SQL Database
Help I deleted my Logical Server
Have you ever experienced that you accidentally deleted your Logical Server in Azure? Because, for example, you made your Pipeline wrong. Surely. And of course you didn’t have a backup in your storage either.
Well I must confess that happened to me recently. It was on my test environment but if you delete a configuration database with your metadata it is quite annoying.
How to Resolve?
But there is a solution to get the deleted Azure SQL databases back.
You need to take the following steps for this:
- Recreate the Logical server with the same name and in the same region.
- Do not re-deploy the deleted databases from your pipeline.
- After the Logical Server has been created, click Create Database in the Azure Portal
- Go directly to the tab Additional Settings
- Select Backup
- Search for your deleted Logical Server and you will see that you can restore your removed databases.
- Select the correct database, click on review and create. Your database will now be restored
- The last thing you need to do is to remove the datetime extension from your database
- You can now start using your database again and all security roles that were there before are also present.
- Repeat above steps in case you had more databases attached to the same server.
It’s a fairly simple process, but you just need to know it. And it will ultimately save you a lot of time and frustration.
If you have any questions regarding the above, please let me know.