Backup to URL using Azure Data studio

SaikrishnaE 51 Reputation points
2022-11-14T21:50:02.45+00:00

How can we backup the sql server database to URL using azure data studio, the option is greyed out in the azure data studio

Azure SQL Database
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ronen Ariely 15,101 Reputation points
    2022-11-14T23:20:45.003+00:00

    Backup to Azure storage is very simple. You just need to create the container in the Azure -> CREATE CREDENTIAL in the SQL Server -> backup TO URL

    (1) Create storage - create container -> get the 260265-image.png of the storage.

    (2) Open Azure Data Studio

    USE master  
    GO  
       
    CREATE CREDENTIAL [UseAnyNameYouWant]   
    WITH IDENTITY = '<Azure Storage Account Name>'   
    ,SECRET = '<use the storage Access key>';  
    GO  
      
    BACKUP DATABASE [DatabaseName]    
     TO  URL = N'https://<storage name>.blob.core.windows.net/local-sql/mybackup.bak'  
         WITH CREDENTIAL = 'UseAnyNameYouWant'    
        ,COMPRESSION    
        ,STATS = 5;    
    GO