Azure Files and filesystem change notification

Microsoft documentation reagarding how Azure Files handles FSN on SMB shares is bit vague. So I ran (AI generated) custom test suite, results below.

Azure Files SMB CHANGE_NOTIFY Test Report

Summary

This test verified that Azure Files SMB sends file change notifications between separate SMB clients.

One Windows Server 2025 VM wrote files to an Azure Files share. A second Windows Server 2025 VM had the same share mounted and monitored it with System.IO.FileSystemWatcher, which uses Windows ReadDirectoryChangesW.

Changes made by the writer were seen by the watcher without polling the directory tree. All tests that were run passed. A separate randomized stress test also passed with 10,000 of 10,000 expected notifications observed, with no missing events, watcher errors, or buffer overflows.

Test setup

The test ran in Azure Sweden Central with two Windows Server 2025 Azure Edition VMs.

afn-write (Windows Server 2025 Azure Edition, Standard_D4as_v6)
        |
        | SMB 3.1.1
        v
Azure Files (StorageV2 / Standard_LRS, TransactionOptimized)
        |
        | SMB CHANGE_NOTIFY
        v
afn-watch (Windows Server 2025 Azure Edition, Standard_D4as_v6)
|
| SMB 3.1.1
v
System.IO.FileSystemWatcher

Both machines accessed Azure Files share over SMB 3.1.1 using the storage account shared key. The storage account used its public endpoint, restricted to the lab VNet subnet.

afn-watch kept an active FileSystemWatcher on the share. afn-write changed files and directories through its own SMB session.

The tested path was therefore:

Writer SMB client
      |
      v
 Azure Files
      |
 SMB CHANGE_NOTIFY
      |
      v
Watcher SMB client
      |
ReadDirectoryChangesW
      |
FileSystemWatcher

Functional test results

CaseFixtureStatusExpectedObservedMissingWatcher errorsOverflowDuration msp50 msp95 msMax ms
T01file_createpass1100018.54429.88729.88729.887
T02file_modifypass1100030.56822.00522.00522.005
T03file_renamepass1100036.66162.69462.69462.694
T04file_deletepass1100017.43568.84368.84368.843
T05dir_createpass1100025.03439.68839.68839.688
T06dir_renamepass1100043.84454.89954.89954.899
T07dir_deletepass1100048.81864.71064.71064.710
T08recreatepass2200037.33623.90637.79537.795
T09atomic_replacepass1100033.90733.32533.32533.325
T10burst100pass1001000001730.88449.78768.68376.076


Every tested create, modify, rename, delete, recreate and atomic replace operation was seen by the watcher. There were no missing required events, watcher errors, or buffer overflows.

The 100-file burst produced all 100 expected Created events. Each file also produced a Changed event, and creating the test directory produced one additional Created event.

The raw event stream for that test contained 201 callbacks:

100 × file Created
100 × file Changed
  1 × test directory Created

None of the required Created notifications were missing.

10,000-operation stress test

A separate randomized stress run was performed with 10,000 filesystem mutations.

  • 10,000 / 10,000 expected notifications observed

  • 0 missing notifications

  • 0 watcher Error events

  • 0 buffer overflows

  • 39.90 operations/s

  • 250.65 seconds total writer time

  • p50 latency: 50.2 ms

  • p95 latency: 71.6 ms

  • maximum latency: 168.9 ms

The run included file and directory creation, modification, rename and deletion, as well as 1,000 atomic file replacements.

Results by operation type

OperationExpectedObservedMissingMissing ratep50 msp95 msMax ms
create_file1750175000.00%50.95673.070153.856
delete_file1650165000.00%48.78869.03286.020
modify_file1100110000.00%50.45471.14988.097
rename_file1100110000.00%47.46968.52882.597
create_dir1200120000.00%51.78972.77488.117
rename_dir1100110000.00%52.46174.720168.936
delete_dir1100110000.00%48.85470.79092.013
replace_file1000100000.00%50.94770.81983.900

Results by expected signal

Expected signalExpected operationsObservedMissing
Created295029500
Changed110011000
Deleted275027500
RenamedOrPair220022000
ReplaceTarget100010000

The watcher produced 5,860 additional callbacks beyond the required notifications. These were mainly Changed events caused by file writes and events related to temporary files used during atomic replacements.

They did not replace or mask required events: all 10,000 expected signals were matched separately.

Event typeMatched callbacksExtra callbacks
Changed21003850
Created29501010
Deleted27501000
Renamed22000

No watcher Error callbacks were recorded during the stress run.

Conclusion

Azure Files SMB delivered file and directory change notifications from one SMB client to another client's active ReadDirectoryChangesW / FileSystemWatcher subscription.

The behavior was confirmed for:

  • file create, modify, rename and delete

  • directory create, rename and delete

  • rapid delete and recreate

  • atomic file replacement

  • a 100-file burst

  • a randomized 10,000-operation workload

In the 10,000-operation stress run, Azure Files delivered every expected cross-client notification at roughly 40 filesystem mutations per second. No events were lost, no watcher errors occurred, and no watcher buffer overflow was observed. Notification latency remained in the tens-of-milliseconds range, with a p95 of 71.6 ms and a maximum of 168.9 ms.

Comments

Popular posts from this blog

Convert Huawei E3372h-153 from HiLink/router-mode to Stick/modem-mode [ UPDATED 2016-09-02 ]

Windows 10 install from USB to Dell Latitude 10 Tablet