restore-and-recover
Recover an Azure SQL Database
Engine behaviour measured 2026-08-29 and 2026-09-03 against an engine reporting
SERVERPROPERTY('EngineEdition') 5, Edition SQL Azure, ProductVersion 12.0.2000.8. Every command line was taken on 2026-09-03 from
the help output of az 2.90.0 and SqlPackage 170.4.83.3 on this machine; the scope and retention
limits come from the Microsoft Learn pages in References. The restores need a real logical
server and were not run, so resource names are placeholders.
The correction
Asked to recover an Azure SQL Database, an agent trained on the boxed engine reaches for
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.