Azure File Sync

This article has not been completed yet. However, it may already contain helpful Information and therefore it has been published at this  stage.

Prerequisites:

  • working on-premises DFS Replication environment (see Link)

Onboarding the first Server....

$srvName = '<Server>'
$rgName = '<Ressource Group>'
$fsName = 'FileSync1'

New-Item -Type Directory -Path "\\$srvName\c$\Temp" -Force
Copy-Item -Path C:\Temp\StorageSyncAgent_WS2022.msi -Destination "\\$srvName\c$\Temp\" -PassThru

Invoke-Command -ComputerName $srvName -ArgumentList ($rgName, $fsName) {
	param($rgName, $fsName)
	Install-PackageProvider -Name NuGet -Force; 
	Install-Module az.StorageSync -Force;
	Start-Process -FilePath "C:\Temp\StorageSyncAgent_WS2022.msi" -ArgumentList "/quiet" -Wait;
	Connect-AzAccount -UseDeviceAuthentication; 
	Register-AzStorageSyncServer -ResourceGroupName $rgName -StorageSyncServiceName $fsName | Out-Null;
	Write-Output "Script finished"
}

When prompted with a WARNING message to sign in -> sign in ;)

Onboard the second Server using the StorageSync Agent Script above...

Remove DFS Replication

We leave the namespace as it is, because we still want to give our users the possibility to access it centrally.

Enable Cloud Tiering

# Cloud Tiering Test using fsutil

Enter-PSSession -computername  <Server2>
fsutil file createnew S:\Data\report1.docx 254321098
fsutil file createnew S:\Data\report2.docx 254321098
fsutil file createnew S:\Data\report3.docx 254321098
fsutil file createnew S:\Data\report4.docx 254321098
Import-Module "C:\Program Files\Azure\StorageSyncAgent\StorageSync.Management.ServerCmdlets.dll"
Invoke-StorageSyncCloudTiering -Path S:\Data 


Look for Files with the attribute L, M, and O, which indicate that the tiering took place.

References:

https://it-infrastructure.solutions/implementing-distributed-file-system-replication/

Deploy Azure File Sync
Learn how to deploy Azure File Sync, from start to finish, using the Azure portal, PowerShell, or the Azure CLI.
Planning for an Azure Files deployment
Understand planning for an Azure Files deployment. You can either direct mount an Azure file share, or cache Azure file shares on-premises with Azure File Sync.