restore-and-recover
Recover an Azure SQL Database
The scope and retention limits come from the Microsoft Learn pages in References. Resource names in the commands are placeholders.
Where the usual answer goes wrong
The habit from the boxed engine is RESTORE DATABASE ... WITH REPLACE, BACKUP DATABASE,
RESTORE HEADERONLY or ALTER DATABASE ... SET RECOVERY. None of that surface exists here. Learn
is blunt: you recover using the portal, PowerShell, the Azure CLI or the REST API, and you can't
use Transact-SQL. The
second wrong belief compounds the first. Learn again: you can't overwrite an existing database
during restore. Every restore creates a new database under the name you pass, and moving it to
where the application connects is a step you perform yourself. Nothing warns you if you skip it,
so the failure surfaces later as a connection error blamed on the application.