Pythian Blog: Technical Track

How to fix SQL backup to URL error: The remote server returned an error: (400) bad request

Problem:
You are trying to take a native SQL Backup to URL and you receive the error below:
Msg 3271, Level 16, State 1, Line 1 A nonrecoverable I/O error occurred on file "https://MyStorageAccount.file.core.windows.net/MyContainer/Adventureworks_full_20190420.bak:" Backup to URL received an exception from the remote endpoint. Exception Message: The remote server returned an error: (400) Bad Request.. Msg 3013, Level 16, State 1, Line 1 BACKUP DATABASE is terminating abnormally.
 
Cause:
You are trying to save a blob file using to non-blob storage or not using the Blob storage endpoint. Check your URL to see if you are pointing to the correct one. SQL Server backups can only be saved to Blob storage. If you are using general purpose storage, you will have multiple endpoints for different usage. You should be using the Blob url for SQL backups - see from the picture below. The one in the green box is the Blob storage endpoint. Using any other endpoints would result in a Bad Request Error. The same is true when using the other endpoints. You should be using it for the correct file types.  
Fix:
Review the url path you are trying to restore to and make sure you are using the correct endpoint for Blob Storage.

No Comments Yet

Let us know what you think

Subscribe by email