I'm attempting to backup a database (full backup, in simple recovery) to Azure storage, replacing a bak file that already exists, then restoring the new backup. Doing a regular backup and restore works fine, but when I replace a backup in Azure using
WITH FORMAT, any subsequent restore commands fail with
The media family on device 'https://account.blob.core.windows.net/container/dbname.bak' is incorrectly formed. SQL Server cannot process this media family.
Here's the backup SQL:
BACKUP DATABASE [dbname] TO URL = 'https://account.blob.core.windows.net/container/dbname.bak' WITH FORMAT;
This is with a backup already existing at that URI. This part succeeds, and I can see that the modify date of the blob has been updated. Then running:
RESTORE HEADERONLY FROM URL = 'https://account.blob.core.windows.net/container/dbname.bak'
fails with the above mentioned error. I get the error whether I'm on a different instance or on the same instance as the original database. Is using
WITH FORMAT actually corrupting the backup? What am I doing wrong here?
This seems to be the recommended way to overwrite Azure blob backups.