Hello, Cloud Gurus,
and welcome back for this lesson
where we're going to dive in to implementing
and managing Azure File Sync.
Let's take a look at what we're going to cover.
First up, we'll take an introductory look
at Azure File Sync.
Then we'll explore how Azure File Sync works
and then we'll wrap up with a demo
of deploying Azure File Sync.
Let's get started.
Azure File Sync is a service that allows you
to synchronize or cache Azure Files share data
outside of Azure on Windows file servers.
And Azure File Sync has a few use cases and features
that will make it a very useful addition
to your Windows file servers.
The first use case to be aware of
is the ability for Azure File Sync
to act as a backup service
by replicating your on-premises data to an Azure Files share
where you can create snapshots of the data
and retain the data in case of loss.
Azure File Sync also helps with recovery
by making data immediately available on-premises
from a file share through what are essentially,
file and folder stubs,
that allow you to transparently pull data from the cloud
without waiting for all of the data to synchronize,
which speeds up your recovery.
It also helps with capacity by allowing you to offload data
to an Azure Files share through cloud tiering,
which essentially increases the usable capacity
of your Windows file servers,
and it can also be used to perform replication
between multiple sites in much the same way that DFS does,
by allowing rights at each server location
and storing an additional copy of the data
on the Azure Files share.
To deploy Azure File Sync,
you're going to start with a storage account
and this storage account will need at least one file share.
Then you'll deploy the Storage Sync Service,
which is a separate Azure resource
deployed to manage the replication of your data
between Azure File shares and Windows servers.
And the Storage Sync Service must be in the same region
as your storage account.
Then you'll create a sync group,
which contains at most one cloud endpoint
and the cloud endpoint is your Azure Files share.
And then you'll deploy the Azure File Sync agent
on one or more of your Windows servers
and these file servers can exist in Azure,
on virtual machines or outside Azure
in another cloud or on-premises.
And as part of the installation process,
you will register the server with the Storage Sync Service
and then you'll add one or more server endpoints
to your sync group and these server endpoints
are just folders on your ReFS or NTFS formatted volumes
on your Windows server.
What's important to remember here,
is that a sync group has one cloud endpoint
and one or more server endpoints
and you can synchronize multiple folders
from the same server, but the folder paths must not overlap.
And you can also add server endpoints
from different servers,
but what's also important to know here,
is that a server can only be registered
with one Storage Sync Service.
So it's fairly common to have one file sync service
for all of your servers as long as they're synchronizing
to a cloud endpoint in the same region.
One of the key features of Azure File Sync,
is the cloud tiering capability,
and this works by creating what Microsoft calls,
a namespace, which represents the files and folders
on the cloud endpoint on your Windows server.
When the user or application attempts to access the file,
the Azure File Sync agent transparently retrieves the file
or files from the cloud endpoint.
And files can be offloaded or tiered to the cloud endpoint
using a volume free space policy,
which offloads data from the server endpoint
to the cloud endpoint
when free space falls below a percentage that you configure.
Or you can use a date policy,
which offloads files to the cloud
based on the number of days since the file was last accessed
and you can combine the volume free space policy
and the date policy,
but the free space policy takes precedence
with the oldest files being tiered first
until the free space percentage is met.
When you first create a server endpoint,
you'll need to decide
how the initial upload will be performed.
You can perform an authoritative upload,
which means the server will be used
as the source of truth and will override changes
in the file share.
And this is ideal for instances
when you've performed an offline data transfer
to the file share using something like Azure Data Box,
or you can perform a merge,
which will combine the data on the cloud endpoint
with the data on the server endpoint.
And in most cases, you'll want to do
your initial upload using a merge.
The most important difference
between merge and authoritative upload,
is that authoritative upload will delete data
from the cloud endpoint
and this ensures that the cloud endpoint
matches the server endpoint exactly.
You'll also need to decide how files will be downloaded
from the server endpoint
and you can just download the namespace,
which will essentially leave the data on the cloud endpoint
or you can download the namespace first
and then download the data,
which is ideal for when you want
all of the content on the server eventually, but
you want to be able to access the file server immediately
and allow the files to be recalled on demand if required.
With this option, the latest files are recorded first
up until any cloud tiering limits,
or you can avoid tiered files entirely,
which will show only files on the file server
once they have been completely downloaded
from the cloud endpoint
and this will avoid any scenarios
where you'll have slow file access
while users or applications wait for the file
to be pulled from the cloud endpoint.
But using this option does increase the time
until all of the files are available on the server endpoint.
Now, for any additional servers
that you add to the sync group,
you'll not need to decide on initial upload,
only initial download
and we'll take a quick look at that in the demo.
All right, let's help tile this together
and take a look at deploying Azure File Sync.
We have an existing storage account with a file share.
In this demo, we'll create the Storage Sync Service.
Then we'll create a sync group,
which will add our file share as a cloud endpoint,
and then we'll deploy 2 server endpoints
on different servers.
So we'll install the Azure File Sync agent
and register those servers.
And then we'll add the server endpoints.
And finally, we'll test some replication scenarios,
including conflicts.
Let's take a look at the demo.
All right, so here we are in the Azure portal.
Let's go ahead and create a Storage Sync Service.
So we'll go ahead and select Create.
We'll search for Azure File Sync.
We'll go ahead and hit Create.
And we're okay to use the resource group
that we currently have selected,
we just need to provide a name for the Storage Sync Service,
so I'll just paste the name in there
and I'm just going to make sure I select the region
that is the same as our storage account,
and that's Australia East.
And we don't need to configure
any additional options at this stage,
so I'll go ahead and select Review and Create
and then we can go ahead and hit Create.
This will just take a moment to deploy,
so we'll come back when this is done.
All right, that Storage Sync Service has now been deployed,
so now let's go ahead and create a sync group.
So we'll navigate to the resource.
And then we'll navigate into sync groups.
And then we'll click to create a sync group.
We just need to provide a sync group name.
I'm going to use the name fileserversyncgroup.
I'll go ahead and select the storage account
that we want to use.
And now we just need to provide
the Azure Files share that we want to use.
And then we can go ahead and hit Create.
This will just take a moment to create
and add the cloud endpoint,
so we'll come back when this is done.
All right, that sync group has been created.
Now, let's deploy the File Sync Agent.
To do that, we'll navigate down to registered servers
and we'll click to download the Azure File Sync agent.
So I'll download this agent
and then I'll jump across to our first file server
and we'll pick up from there.
All right, now, here I am on CORP-BNE-FS01
and I've gone ahead and downloaded the Storage Sync Agent,
so we'll go ahead and run the installer now.
We'll go ahead and select Next.
Select next again on the license agreement.
Next one more time.
We're not using a proxy server,
so we'll go ahead and click Next.
Always want to use Microsoft updates, so we'll go Next.
And I'm just going to automatically enable updating
of the File Sync Agent every Sunday at 11:00 p.m.
and if you're deploying the Azure File Sync agent
in your environment,
you could choose not to update automatically
or to minimize the chance of disruption,
you could choose an automatic update time
that suits your environment.
We'll go ahead and click Install.
This will just take a little while to install
and then we'll come back
when it's time to register the server.
All right, the installation of the File Sync Agent
is now complete, so I'll go ahead and click Finish,
and then we'll go through the process
of registering the server.
We'll go ahead and click OK.
Now, I'll go ahead and sign in
and I'll just sign in with my account here
and then we'll come back when this is done.
I'll select my resource group
and I'll go ahead and select the Storage Sync Servers
that we've just created
and then we go ahead and click Register.
All right, now this is installed,
registered, and it's now just running
a network connectivity test
and I want to demonstrate a few different scenarios,
so I'll repeat this process on a second server,
CORP-BNE-FS02 and then I'll come back here when that's done.
All right, so I finished adding the second server
and if I navigate back to sync
and then registered servers, we can see that we have
both our registered servers configured here.
Now let's go ahead and add a server endpoint.
So to do that, we'll navigate to sync groups.
We'll select our file server sync group.
And then we'll add a server endpoint.
We're going to select our first registered server.
And we're going to use the file path R:\Data,
which is a file share on our server
and if I just expand Cloud Tiering for a moment,
you can choose whether to enable or disable cloud tiering
and you can see the volume free space
and date policies that we spoke about in the lesson.
I'll just minimize that now.
And then run an initial sync.
We need to choose how we want to do our initial upload
and we can do a merge, which is the most common method
or we can use an authoritative upload.
And this server is the only server that has any data on it,
so we're going to do an authoritative upload,
but we could do a merge as well
and the results would be the same.
And because we've picked an authoritative upload,
there is no initial download to perform,
because the file share contents
will match the contents of our first file server.
All right, so we can go ahead and hit Create.
Now, we'll wait for that process to complete
and then once that first server endpoint has been added
and it's successfully synced,
we'll go ahead and add a second server endpoint
for our second file server.
So we'll come back once that's done.
All right, our first server endpoint has been added.
Now, let's go ahead and add our second server endpoint,
so I'll just select Add Server Endpoint.
Select our second registered server.
Provide the path to the data on that server as well,
which is also R:\Data.
And you can see, we don't get an initial upload
for this server being the second server in the sync group,
but we do get an initial download.
And you can see that you can download the namespace first
and then recall the content.
You can just download the namespace,
which will essentially put stub files on the server
and then the files will be downloaded as required
or you can completely avoid cloud tiering
and have the files only appear
once they've completely downloaded from the file share.
For our purposes, we're going to go ahead
and download the namespace first.
We'll go ahead and hit Create.
This will just take a moment to add this server endpoint
and then report as healthy,
so we'll come back when that's done.
All right, we've successfully added
both of our server endpoints
and all of our files are syncing.
All right, now let's jump across to our first file server
and we'll create some test files.
So here I am on the first file server.
We'll just go ahead and launch PowerShell.
Now, let's create some files on both servers
at the same time to test what happens when conflicts occur.
So we'll create a file with the same name
on both of our file servers
and to do that, we're just going to create a string
and we'll pipe that to the Out-File Powershell cmdlet
and create a file on the data directory
on each of our servers.
So I'll just paste that command in.
All right, we've gone ahead and created those files.
Now, let's wait for synchronization and see what happens.
All right, synchronization is now complete,
so I'll just drag this PowerShell window down a bit
and we can see that we have our test conflict file created
and then we have another test conflict file
and the server endpoint name is appended to the file.
So what's happening here, is that last write wins
and we wrote to the CORP-BNE-FS02 server last.
So the FS02 file is the file
that's currently saved on the server with the correct name
and because the test conflict file on COPR-BNE-FS01
was created around the same time, this is a conflict.
So Azure File Sync has automatically appended
the server endpoint name to the end of the name.
All right, that's all I wanted to cover in this demo.
Now, let's wrap up with a bit of a summary
of what we've covered in this lesson.
Azure File Sync allows you to synchronize
or cache Azure Files share data
outside Azure on Windows file servers
and synchronization is managed by the Storage Sync Service,
which must be in the same region as the storage account
that contains the share that you wish to replicate
and a sync group contains one cloud endpoint at most
and one or more server endpoints on one or more servers.
And a server can only be registered
with one Storage Sync Service at a time
and cloud tiering can be used to free up space
on your server endpoints
using either a percentage of free space
on the target or the date accessed or both.
All right, that concludes this lesson.
Thanks for being with me.
I hope you found this useful
and I look forward to seeing you on the next lesson.