info@techdevops.com | 437-991-3573 | Data Engineering Services
TechDevOps.com
Resources Tools
Experts in Microsoft SQL Server on Windows, Linux, Containers | Clusters, Always On, FCI | Migrations, Cloud, Performance



Use AzCopy to copy SQL Server Backup Files to Azure Blob Storage
by BF (Principal Consultant; Architecture; Engineering)
2017-06-02








Within our Microsoft Cloud Environment we use a 3rd party product from Red-Gate - SQL Backup - to perform SQL Server backups for our both our System and User Databases. Backups are compressed and written locally on each Azure Virtual Machine and then we use AzCopy to copy those files to an Azure Blog Storage Container where they are stored for a specified retention period.


Full Components:

(1) Red-Gate SQL Backup Tool

(2) SQL Server Agent Job: (Type: Operating System (CmdExec)) - calls a batch file

(3) Batch File - contains script for Azcopy application call

(4) Powershell - code used for retention of x days. (See Here)



Batch File:

@echo off
cd C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy
azcopy /Y /Source:H:\SQLBackups\ /Dest:https://xyz.blob.core.windows.net/redgate /DestKey:xyz==


/Y – Suppresses all AzCopy prompts

/Source
Specifies the source data from which to copy. The source can be a file system directory, a blob container, a blob virtual directory, a storage file share, a storage file directory, or an Azure table.

/Dest
Specifies the destination to copy to. The destination can be a file system directory, a blob container, a blob virtual directory, a storage file share, a storage file directory, or an Azure table.

/DestKey
Specifies the storage account key for the destination resource.



Resources:

Transfer data with the AzCopy on Windows

Red-Gate