Backup to URL in Azure

 The scenario is describing about how to take the backup from the SQL Server in Azure Virtual machine and store the backup file of particular database in Azure Container. 

SELECT * FROM sys.credentials
DROP CREDENTIAL [https://123storages.blob.core.windows.net/123container]
GO
USE master
GO
CREATE CREDENTIAL [https://123storages.blob.core.windows.net/123container]--this link you find in the continaer properties
WITH IDENTITY = 'Shared Access Signature'--This shouble alwas shared access signature.Dont change the value
/*the below value came from Shared access signature of continer.*/
/*Use Container Shared access signature instead of Storage access signature.*/
,SECRET='sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-06-19T18:52:52Z&st=2021-06-19T10:52:52Z&spr=https&sig=Tgt6H8qXTKVroVkEqmHUk2ruP8HFnk%2FsN%2BeHMP18tVQ%3D'; -- Access key
GO
BACKUP DATABASE TEST2  
TO URL = N'https://123storages.blob.core.windows.net/123container/TEST2.bak' 

Comments

Popular posts from this blog

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

Pre login Handshake or Connection Timeout Period

Transparent Data Encryption(TDE) with Master Key and Certificate in SQL Server