Filespace to Azure container blob backup with AzCopy

  • Updated
In this article we will engineer a Filespace to Azure blob backup which utilizes Microsoft's AzCopy to backup your Filespace contents as native blobs within an Azure storage account. 
Our script will synchronize our Filespace contents with `azcopy sync` and `--delete-destination` to ensure our storage account container matches our Filespace by purging any data no longer on the source.
You can additionally enable soft deletes and versioning to protect against deletes and retain multiple data versions which in conjunction with our in-built snapshots provides added protection and recovery determined by your retention period. 
To get started, we will recommend an Azure Virtual Machine (VM). It is important to locate your VM in the same region as your storage account to avoid unnecessary egress or network transfer fees. Depending on where your Filespace is located might influence provider charges. 
We will assume Server Core (or Desktop Experience if preferred) and provide step-by-step PowerShell commands.
Install LucidLink
Invoke-WebRequest -OutFile lucidinstaller.msi
msiexec /i "lucidinstaller.msi" /qn 
Install and configure LucidLink service
lucid service --install
lucid service --start
lucid link --fs <filespace.domain> --user <user> --password <password> --mount-point <mount-point>
Install AzCopy
Invoke-WebRequest -OutFile
copy .\azcopy\azcopy_windows_amd64_10.15.0\azcopy.exe C:\Windows\System32\
Clean-up installers
Remove-Item .\lucidinstaller.msi
Remove-Item .\azcopy*
Download "ll-azure-backup.ps1" script
Invoke-WebRequest -OutFile ll-azure-backup-ps1
Modify script AzCopy storage account, container and shared access signature: "https://<storageaccount><container>?<sharedaccesssignature>". Remove shutdown if the VM will continuously run and execute via a more frequent scheduled task. Script checks to ensure it is not still running between tasks.

Run the script

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "ll-azure-backup.ps1"
Schedule At Startup task when shutting down and powering up according to Azure Start/Stop VMs or leverage Azure CLI to remotely start VM.
$Trigger= New-ScheduledTaskTrigger -AtStartup # Specify the trigger settings 
$User= "NT AUTHORITY\SYSTEM" # Specify the account to run the script 
$Action= New-ScheduledTaskAction -Execute "powershell.exe" -Argument '-ExecutionPolicy Bypass -File "c:\ll-azure-backup.ps1"' # Specify what program to run and with its parameters 
Register-ScheduledTask -TaskName "ll-azure-backup" -Trigger $Trigger -User $User -Action $Action -RunLevel Highest –Force # Specify the name of the task
Reach out to LucidLink support should you require any assistance. 

Was this article helpful?

0 out of 0 found this helpful