BACKUP LOG Write Fail to Azure Storage

sidney l 21 Reputation points
2022-06-13T18:07:29.267+00:00

Hello,

We have a SQL VM running out of Azure with SQL Agent jobs running BACKUP LOG every x hours to Azure Blob. These jobs have been running fine for a long time until recently. We keep getting the below error and these jobs fail intermittently for various databases. They don't always fail at their scheduled run. If it fails, I can re-run the job manually like two minutes later without any issue. I have looked up online and haven't found a solution to my problem.

Does anyone know why and how I can fix this? Any help is appreciated.

Message Executed as user: DSN\xyz. Write on "https://xyz.blob.core.windows.net/CW_Data_LOG_06102022_140000.TRN" failed: 13(The data is invalid.) [SQLSTATE 42000] (Error 3202) BACKUP LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013).
The step failed.

SQL Server on Azure Virtual Machines
Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
Developer technologies | Transact-SQL
SQL Server | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. YufeiShao-msft 7,146 Reputation points
    2022-06-14T08:41:54.85+00:00

    Hi @sidney l

    From your shown error, it seems like the file may be corrupted, please try to restore to a different server to confirm the drive or only the file is corrupted, or unfortunately both
    https://dba.stackexchange.com/questions/98153/error-3203-restoring-sql-server-backup-the-data-is-invalid

    If there is a backup, replace the file, if not, you may need another latest backup file

    -------------

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Andy Soushek 0 Reputation points
    2025-07-02T21:20:53.65+00:00

    I realize this post is quite dated now, but I was running into this issue and found the fix for what I was seeing.
    We've been writing log backups to BLOB storage for some time, then our backup jobs started failing with the same error as the OP. After hours of troubleshooting, the fix ended up being the removal of a retention rule we put on the storage container.

    It turns out that setting up a retention rule via the specific Blob Container page in Azure > Access Policy > Immutable Blob Storage, can block much of the user functionality within the Blob Container. I removed the rule we had in place and the issue went away.

    I was able to put the retention rule in another place. From the Storage Account screen in Azure > Data Management > Lifecycle Management > Create rule w/ filter > Add the container name + / to the filter. example: container named 'log-backup' would have a filer of 'log-backup/' so the rule only applies to that specific container and not all of the containers within the storage account.

    Hopefully this helps someone else out who had the same issues I did.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.