question

amvi avatar image
0 Votes"
amvi asked Yufeishao-msft commented

SQL Server 2014 Backup to URL error

Hello, We have a database on a SQL Server 2014 (SP3 12.0.6433.1) and I'm trying to take a backup to Azure Blob Storage. I have followed this document (https://docs.microsoft.com/en-us/previous-versions/sql/2014/relational-databases/backup-restore/sql-server-backup-to-url?view=sql-server-2014) and created a credential using identity and access key using the following code: CREATE CREDENTIAL mycredential WITH IDENTITY = 'mystorageaccount' ,SECRET = '<storage access key>' ; and tried to do a backup using the following code: BACKUP DATABASE mydb TO URL = 'https://mystorageaccount.blob.core.windows.net/mycontainer/mydb.bak' WITH CREDENTIAL = 'mycredential' ,COMPRESSION ,STATS = 5; GO However, I am getting the following error: ![215533-image.png][1] Msg 3271, Level 16, State 1, Line 1 A nonrecoverable I/O error occurred on file "https://mystorageaccount.blob.core.windows.net/mycontainer/mydb.bak:" Backup to URL received an exception from the remote endpoint. Exception Message: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.. Msg 3013, Level 16, State 1, Line 1 BACKUP DATABASE is terminating abnormally. The Azure storage account I am using is a General Purpose V1 Storage account. However, I have also tried this with a V2 account. I tried doing a backup from a SQL Server 2012 database and it was working. But it isn't working for SQL 2014. Any idea why? [1]: /answers/storage/attachments/215533-image.png

sql-server-generalsql-server-transact-sqlazure-storage-accountsazure-blob-storageazure-migrate
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yufeishao-msft avatar image
0 Votes"
Yufeishao-msft answered Yufeishao-msft edited

Hi anonymous user


This issue may occur because the storage account that you are trying to back up to was created with the Account Kind setting set to Blod

Please designate a container in this storage account for backup to URL

https://docs.microsoft.com/en-us/sql/relational-databases/backup-restore/sql-server-backup-to-url-best-practices-and-troubleshooting?view=sql-server-ver16#troubleshooting-backup-to-or-restore-from-url



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.





· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hey @Yufeishao-msft ,
The storage account used is "General Purpose V1", not Blob

0 Votes 0 ·
Yufeishao-msft avatar image
0 Votes"
Yufeishao-msft answered Yufeishao-msft commented

Hi anonymous user

Could not establish trust relationship for the SSL/TLS secure channel..

Please check your SQL Server whether enable TLS protocol version 1.2 with the registry:

 Registry Key Name: 
    
 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client
 Value 0
 Name:          Enabled
 Type:            REG_DWORD
 Data:            0x1

If yes

You had better change the supported TLS version or use cumulative updates for SQL Server (Cumulative Update 5 for SQL Server 2014 SP2)

https://support.microsoft.com/en-us/topic/kb4017023-sql-server-2012-2014-or-2016-backup-to-microsoft-azure-blob-storage-service-url-isn-t-compatible-for-tls-1-2-e9ef6124-fc05-8128-86bc-f4f4f5ff2b78




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.








· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

If the reply above was helpful please mark as accepted answer so it can be helpful for other community members with same questions.

Regards

0 Votes 0 ·

Yes, we checked the registry and SQL Server has enabled TLS 1.2 protocol.

The 'Cumulative update 5 for SQL Server' is for the 2014 SP2 version right? As we are on 2014 SP3, shouldn't the update already be part of it?

0 Votes 0 ·

Then you should chekc if the certificate still vaild,

0 Votes 0 ·

If the reply above was helpful please mark as accepted answer so it can be helpful for other community members with same questions.

Regards

0 Votes 0 ·