Let us go ahead and see a demo of it.
First of all, create a new VM with Windows Server 2016 Datacenter image. Create a new resource group for this. Choose DS2v2 as the size.
Give username and password. Allow port 3389 and click Review + Create. Once the validation gets completed, click create.
Put the storage account in the same resource group as earlier. Give it a name and keep the location same as well. Choose Standard Performance. StorageV2 and LRS. Hot Access tier.
Once the storage account gets created, go to it and select File Shares.
Click here to create a new file share.
Give a name to your file share and don’t give a quota.
It will get created. And since we didn’t give a quota to it, it automatically assigned itself a quota of 5TB.
Click on the context menu (three dots) and click connect.
Now if we were working with normal file share, we would simply choose a drive letter and copy this script and run it in the PowerShell and then the file share would be available on the machine. But we are not going to do that here.
First of all, go to All Services and search for Storage Sync Services. Click on the Star to add it to the favourites.
It will now be added to your portal menu.
Create a resource and search for Azure File Sync. When the blade pops up, click create.
Put it in the same resource group as the other resources. Give it a name and put it in the same location as well. Click Review + Create and then click Create.
Go to Storage Sync Services and select the file sync that you created.
Next, add a sync group. Sync groups are what determines the sync topology for a set of files, and the endpoints within each group synchronize with each other.
Give the sync group a name. Select the storage account that you created and then select the file share that you created in it. Click Create.
Once it gets created, you will see it in the list. Click on it.
You will see something like this. It will show that there is 1 cloud endpoint and 0 server endpoints. The Server Endpoint is the location on a file server to which Azure syncs. The Cloud Endpoint is essentially the Azure file share.
Go to the VM that you created and download the RDP file to connect it. Connect to the VM.
Once you get logged into the VM, open IE and search for Azure File Sync Agent download and click this link.
NOTE: You might have to add the website every time URL loads.
Click Add and add the page. You might have to do this several times.
Click Download on the page.
Choose the file for Server 2016 and click next.
Click Add and add the page. You might have to do this several times.
Once it gets downloaded, you will find it in the downloads folder. Double click and install it with all the default settings.
Once it gets installed, it will first check for an update. Click OK.
Next, it will ask you for server registration. Choose Azure Public Cloud and click sign in. Provide your credentials and sign in.
Select your Azure Subscription. Choose the resource group in which the storage sync service is and select the sync service. Click Register.
Once the registration is successful, you would see this. Click OK.
Go back to the file sync and click Add Server endpoint.
Add the registered server and for the path, give a path to the D drive.
Enable cloud tiering and set the % to 95. Set the number of days for the cache files to 180. Cloud tiering is a feature of Azure File Sync in which frequently accessed files are cached locally on the server while all other files are tiered to Azure Files based on policy settings.
Now there would be 1 Server endpoint. Initially, it would show as pending but after a while, it would be healthy.
Back in the VM, you will now see a folder in the selected drive.
Inside the folder, copy the executable that you had downloaded earlier. Copy it several times.
View the properties of the folder in which you have copied the files. Right now it would be in gigabytes. So far the sync has not been started. But if you check this after a few hours, the size would be reduced because the sync would have happened.
Once the sync gets completed, you will see that the size on disk has been reduced to just megabytes.