Azure File Sync - files not deleted on server endpoint

Paweł Giemza 122 Reputation points
2020-10-27T11:07:32.643+00:00

We have an azure file sync deployed on windows server 2019 standard. The files put in local (onprem) drop folder are automatically synced to azure file share and processed by a function app. The processed files are removed from the file share inside the azure function.

The problem is that the deleted files are still available on the server endpoint even if they are no longer visible in storage explorer in Azure.

Tried to invoke Invoke-AzStorageSyncChangeDetection but it seems to only work for file updates and additions but it ignores the deletions.

Issue can be also reproduced by removing already synced file from azure portal: the file is no longer available in azure share but remains on the on premise server.

I'm studying the documentation but can't find any info why it doesn't work. Any ideas?

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,317 questions
{count} vote

Accepted answer
  1. deherman-MSFT 37,666 Reputation points Microsoft Employee
    2020-10-27T15:42:32.817+00:00

    @Anonymous
    Files added to a server endpoint (in your case, your Windows Server 2019 server) will sync more-or-less immediately (factoring in data transfer times). Files added or deleted from an Azure file share directly will take longer to sync, full enumeration of the Azure file share occurs every 24 hours. The deleted files should be removed after this sync. The reason for this discrepancy is that Windows has a feature that Azure Files not (yet) have: the USN journal. NTFS logs changes to the file system in the USN journal so that applications installed on Windows, including Azure File Sync, can see that files that they care about have changed. When Azure File Sync sees a file has changed through its monitoring of the USN journal, we initiate a sync session. For more information you can refer to the Azure File Sync FAQ.

    The Invoke-AzStorageSyncChangeDetection cmdlet will not detect files that are deleted in the Azure file share. If files are deleted in the Azure file share, they will be detected when the change detection job runs.

    Hope this helps. If you have further questions or issues please let us know.

    -------------------------------

    Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.