SQL SERVER – Fix: 400 – Bad Request Authentication Failed for Account and the Provided Key. Please Provide a Valid Key and Try Again

While helping a client with Azure environment, I came across an interesting error. I this blog I would explain cause and fix of error “Authentication failed for account sqlauthprembackup and the provided key. Please provide a valid key and try again.”

In SQL Server Management Studio, there is an option to connect to storage to look at the backups.

Azure Storage.

When I tried with one of my Azure storage accounts, it failed with below error:

Authentication failed for account sqlauthprembackup and the provided key. Please provide a valid key and try again.
The value for one of the HTTP headers is not in the correct format. (Microsoft.SqlServer.StorageClient)
The remote server returned an error: (400) Bad Request. (System)

Here is the screenshot of the error

SQL Server Management Studio Error.

WORKAROUND/SOLUTION

It turned out that storage account which I created was of “Premium” storage tier. As per documentation: (Refer Limitation section)

Backup to premium storage is not supported.

To verify you can refer properties as shown below.

Sqlauthprembackup Premium/Hot.

I wish Microsoft should have provided some meaningful error rather than a cryptic error.

  • The value for one of the HTTP headers is not in the correct format.
  • The remote server returned an error: (400) Bad Request.

When I used an account of Standard tier, it worked fine, and I was able to connect to storage.

On a side note, when I used SQL Server Management Studio 18.1 (Preview), I can see that the UI is changed completely. In this version, we need to login to Azure using UI not via earlier ways of access keys.

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.

SQL Error Messages, SQL Server, SQL Server Management Studio, SQL Server Security
Previous Post
SQL SERVER – Always On Availability Group Listener Missing in SSMS but Working Fine in Failover Cluster Manager
Next Post
SQL SERVER – Error 0x800f081e or ErrorCode: – 2146498530 While Installing SQL Server Management Studio (SSMS)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.