Objective: I am trying to backup our on premises SSMS databases to our Azure Cloud storage.
I have a blob container https://zutosqlbackupslive.blob.core.windows.net/dw1/ This is set to private.
I have created a Shared Access Signature with full permissions (all resource types allowed, all permissions allowed), with a start date of yesterday, and an expiry date of next year.
It is set to allo HTTPS and HTTP, using key 1.
Using this SAS, I am able to access a test image in the blob by adding it to the end of the URL for the image file. So my SAS works.
The SQL script
CREATE CREDENTIAL [AzureDWBackup]
WITH IDENTITY = 'Shared Access Signature',
SECRET = '<<SAS key>>' -- this the key taken from the highlighted section of the screenshot
GO
BACKUP DATABASE Maintenance
TO URL = 'https://zutosqlbackupslive.blob.core.windows.net/dw1/Maintenance_DW1_FullBackup_20062017T1518.bak'
WITH INIT, NOFORMAT, NAME = N'Maintenance_DW1_FullBackup_20062017T1518', STATS = 10
, CREDENTIAL = N'AzureDWBackup'
The resulting error is:
Msg 3298, Level 16, State 2, Line 11
Backup/Restore to URL device error: Error while decoding the storage key.Msg 3013, Level 16, State 1, Line 11
BACKUP DATABASE is terminating abnormally.
Can anybody see from that what is wrong, or suggest what to try next.
?
from your SAS token. Additionally, what is the version of you SQL server? – Bruce ChenCREATE CREDENTIAL [https://{storage-account-name}.blob.core.windows.net/{container-name}] WITH IDENTITY = 'Shared Access Signature', SECRET = 'sasToken'
? – Bruce Chen