We receive weekly FULL and daily DIFF back ups from our hosted ERP quoting system provider. We are using PowerShell code and task scheduler to download the most recent file from a blob container to a local server location we use for our back ups. Once downloaded we have a SQL restore job that uses those downloaded files.
When I download the files from Azure Storage explorer manually and run the restore job it works fine. When I run the restore job from the Powershell downloaded file i get an error.
.bak' is incorrectly formed and can not be read.
Or the code will work perfectly for a week and then stop downloading properly. I receive that same error or it just gets sutck.
I cannot figure out why this is happening. Anyone run into this and fix it?
Is there a better way to get the files to download automatically and then restore? We need to always pull the most recent file for the week.