Automatic Replication of Azure Premium files across regions

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

SctEdulE Admi 
GMT sat 
Fik Share 
(9) 
Re-us Eæt 
Az copy F ile Sync 
LIS Eag 
ding Amopy 
(9) 
RG-us 
File e 
LIS West

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

O WVD-Deployments 
ca Clone 
Fork 
+ New 
Upload file(s) 
Download as Zip 
Hide files tree 
u 
V main v 
Files 
Contents 
File 
Folder 
History 
MI README.md 
Introduction

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

New file 
New file name 
Fileshar&opy.psl 
use slashes to create multiple subfolders like •sub/folder"_ 
Cancel 
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

Commits 
Pushes 
Branches 
Tags 
Pull requests 
Pipelines 
Pipelines 
Pipelines 
Environments 
Releases 
Library 
Task groups 
Deployment groups

Click on “New Pipeline”

No release pipelines found 
Automate your release process in a few easy steps with a new pipeline 
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.

Machine generated alternative text:
All pipelines 
Pipeline Tasks 
> FSLogix Profile Sync Pipeline 
FSLogix Profile Sync Pipeline 
Variables 
R

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

Artifacts 4- Add 
Add an 
artifact

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

Add an artifact 
Source type 
Build 
Azure Re... 
GitHub 
5 more artifact types v 
Project • 
Deployment 
Source (repository) • 
WVD•Deployments 
Default branch • 
maid

Under Stages, Click on “+add a stage”.

In the select a template dialog, select empty Job

Select a template 
Or start with an 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.

Stage 
Replication-Demo 
Properties 
Name and owners of the stage 
Stage name 
Replication-Deme 
Stage owner 
Amal K Abraham

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

까sm丁하에1 
owea-uone)lldau '§

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.

Replication-Demo 
Deployment process 
Agent job 
Run on agent 
Add a task to Agent job

In the Add tasks dialogue, Search for Azure Powershell

Machine generated alternative text:
Add tasks 
All 
Build 
CD Refresh 
Utility Test 
.NET Core 
Package 
Search 
Deploy 
Tool 
Marketplace 
Build, test, package, or publish a dotnet 
application, or run a custom dotnet 
command

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

Azure PowerShell 
Run a PowerShell script within an Azure 
environment 
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

Azure PowerShell version options A 
Azure PowerShell Version O 
Specify 
Latest installed version 
other version

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

Machine generated alternative text:
All pipelines > 
Pipeline Tasks v 
Stage 3 
Deployment process 
Agent job 
Run on agent 
New release pipeline 
Variables Retention Options 
History 
a save 
O I Manage 
Subscription * 
)psspn 
Create release 
C) 
ed to resource group 'mysecureRGI

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

Deployments 
Scheduled release trigger 
Schedule 
not set

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

Scheduled release trigger 
Define schedules to trigger releases 
Enabled 
Create a new release at the specified times 
O sat at 3:00 
CD Mon CD Tue CD wed D Thu D Fri sat 
Sun 
03hV 00m v (UTC) Coordinated Universal Time 
C) Only schedule releases if the source or pipeline has changed

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

Machine generated alternative text:
New release pipeline 
Releases Deployments Analytics 
Create release 
Edit 
All releases v

Hope you find this blog useful. Please let me know your questions if any.

Regards,

Amal K Abraham

WVD Community

India

Advertisement

One thought on “Automatic Replication of Azure Premium files across regions

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s