One of the key limitations of Azure Premium files is that it doesn’t support RA-GRS or GRS Replication. Customers who wants to replicate his Fslogix profiles and MSIX Shares as part of the DR strategy need to rely on third party providers.
In this Blog let us see how we can automate the replication of Azure Premium files with the help of Azure DevOps and Azcopy.
The below logical Architecture diagram explains the automated replication process. In this implementation, the Azure DevOps pipeline will be leveraged to call the azcopy powershell script which is stored in Azure Repo or in Github. We will leverage the Release schedules in DevOps Pipeline to automatically trigger the execution of the script in defined intervals.
Logical Architecture Diagram

Requirements
- Source and Destination File shares
- Azure Devops Project integrated with your Azure Subscription
- Azure DevOps Repo or Github repo
Azcopy command to Sync fileshares
The Azcopy generic syntax for syncing file shares are given below. azcopy sync ‘https://<source-storage-account-name>.file.core.windows.net/<file-share-name><SAS-token>‘ ‘https://<destination-storage-account-name>.file.core.windows.net/<file-share-name><SAS-token>‘ –recursive |
The powershell script is saved in my Github Repo.
wvd/azcopy.ps1 at main · amalkabraham001/wvd · GitHub
Configuration Settings
Head to Azure Devops portal via https://dev.azure.com and navigate to your DevOps Project

Navigate to Repos by hovering your mouse over the name of your project, and selecting the Repos icon. You can select it from the All projects list, or from the Recent projects list if you’ve accessed it recently.
Click on the “three dots” next to your Repo. From the Repo drop down Click on “+New”–> File

In the new file dialog, provide the file name and click on Create.

Provide the azcopy powershell script which I have mentioned in the above section and click on Commit to save the file
Click on Pipelines under your project and Select Releases

Click on “New Pipeline”

The add template dialog will pop up automatically, Click on escape to view the new release pipeline page.

Provide a name you’re your pipeline by clicking on the “New release pipeline” in the top.

Under Artifacts, Click on “+Add an artifact” to link the Repository to your pipeline.

In the “Add an artifact” dialogue, select Azure Repos and select the Repo where you created your azcopy script and click on Add.

Under Stages, Click on “+add a stage”.
In the select a template dialog, select empty Job

Provide the name of Stage. Stages are meant to separate the releases from Dev,Test, Production. Give any name to your stage and click the close button.

Under the stages, Click on the “0 job, 0 task” field to start adding the tasks to pipeline

Click on “Add a task to agent Job” by click on the “+” button next to Agent Job to add the Azure PowerShell task to your pipeline.

In the Add tasks dialogue, Search for Azure Powershell

From the search results, Select Azure Powershell and Click on Add

Provide a name for your task
Select the Azure subscription you linked to the DevOps where the storage accounts reside
Select the script type as “Script file path” and select the script from the Repo.

In the Azure Powershell version, select the latest installed version

Click on “Save” from the top right corner to save the pipeline.

From the Pipeline page, Click on “Schedule not set” icon to set the schedule

In the Scheduled release trigger dialogue, define the schedule and click on close.

You can test the replication manually by clicking on new release from the top right corner of your release pipeline

Hope you find this blog useful. Please let me know your questions if any.
Regards,
Amal K Abraham
WVD Community
India
One thought on “Automatic Replication of Azure Premium files across regions”