Home SQL Compliance Manager SQL SERVER – Backup to URL error: Operating system error 50(The request...

SQL SERVER – Backup to URL error: Operating system error 50(The request is not supported.)

6
0
SHARE


It’s always a good idea to be up-to-the-speed with the current market trend. As a part of my consulting I have been getting calls from clients having issues with Azure. So, I started learning Azure as well. Let us learn about how to fix the URL error.

Recently, I was trying to take backup of the database to Azure and was stuck with an error message.

Msg 3201, Level 16, State 1, Line 4
Cannot open backup device ‘https://sqlauthsqlbackups.blob.core.windows.net/backups/master.bak’. Operating system error 50(The request is not supported.).
Msg 3013, Level 16, State 1, Line 4
BACKUP DATABASE is terminating abnormally.

Before I move ahead, I should share that there are two kinds of backup methods available. In both methods we need to create credentials. The credential can be created using either access keys or SAS token. The method which I was using was with SAS token.

My steps were very simple.

  1. Create a storage account.
  2. Generated the Shared Access Signature (SAS) from the Portal.
  3. Created Credential using SAS Token.
  4. Perform backup of the database using “Backup to URL” command.

SQL SERVER - Backup to URL error: Operating system error 50(The request is not supported.) sas-bkp-01

I searched on the internet and realized that I missed one step, which is not very explicitly called out in Microsoft documentation.

WORKAROUND/SOLUTION

You need to create a Shared Access Policy and a Shared Access Signature for the new container.  There are multiple ways to do it.

  1. Using PowerShell.
  2. Using Storage Explorer.
  3. Using Microsoft Azure Portal.

PowerShell method is explained in this article https://docs.microsoft.com/en-us/sql/relational-databases/backup-restore/sql-server-backup-to-url You can refer code section.

The script which is created does create SAS token, access policy and provides you ready-made T-SQL which you can directly run to create credential.

I have used portal to define the access policy. Here is the screenshot for your quick reference to understand where to click and reach there.

Home > Storage accounts > Account Name > Browse blobs > Blob Name > Access Policy

SQL SERVER - Backup to URL error: Operating system error 50(The request is not supported.) sas-bkp-02

Once we click on access policy, we need to add a new policy and set all permissions along with dates. After doing that I could take backups successfully.

Reference: Pinal Dave (https://blog.sqlauthority.com)



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here