File Sync with Azure Blob Storage

Azure Blob Storage has become a popular option for storing files in the cloud. And SymmetricDS Pro now allows file sync to and from Azure Blob Storage!

Overview
File sync can be from a local file system to Azure, from Azure to a local file system, and from Azure to Azure. Setting up Azure file sync is done in the same way as normal file sync, with a few simple steps.

Parameters
Under the Configure -> Parameters screen, there are two new settings that allow for entry of Azure Blob Storage credentials.

  • file.sync.azure.account.name – This is the name of the storage account in Azure.
  • file.sync.azure.sas.token – This is the Shared Access Signature (SAS) token that will allow for access to the Azure Blob Storage.

The SAS token can be generated under Security + Networking-Shared Access Signature in an Azure Storage Account.

Allow for access to the service, container, and object. Set the end date to whatever duration you are comfortable with. This must be manually updated by the user whenever it expires. If it is allowed to expire, file sync to and from Azure will not work until the parameters are updated also.

Click generate SAS and connection string.
Copy the SAS token and paste it into the parameter in symmetricDS.

The Azure Blob container name is input in each individual File Router or File Trigger as a base directory to have a location to find or send files. This allows for synchronization to and from multiple containers within an account. It also allows for synchronization between two containers in Azure.

File Sync From Azure Blob Storage
Create a router as normal. Next, use the Configure -> File Trigger screen to create a File Trigger with a base directory of azure://<source-container-name> where <source-container-name> is the name of the container that you would like to sync from. If you have not entered the Azure parameters SymmetricDS will prompt you to enter them after saving.

Use the Configure -> File Routing screen to create a File Router that uses both the Azure File Trigger and the Router you created. Set the target base directory.

File Sync to Azure Blob Storage
Create a Router and File Trigger as normal. Create a new File Router, then enter azure://<target-container-name> under the target base directory field, where <target-container-name> is the name of the target blob container.
SymmetricDS can also have a directory specified past the container name. For example, a directory of azure://<target-container-name>/exampleDirectory. This will put all files syncing to this container in the specified directory.

Notable differences with Azure Blob Storage
Azure Blob Storage does not follow a typical file system structure. Directories are only “virtual” in Blob Storage, which means that the directory will not be created if there is not a file inside of the directory. If you attempt to sync a directory with nothing in it, it will not appear until a file has been placed inside.

Summary
File Sync to Azure Blob Storage can be set up quickly and easily to synchronize files to and from the cloud. By setting up a file trigger or file router with a prefix of azure://<Container-name> your files can be kept up to date.

X
Jumpmind Recognized as a Leader in The Forrester Wave™: Point-of-Service Solutions, Q4 2024
Forrester Wave Download