Undesired Updates to Azure File Share Last Modified Date

Lyle B 1 Reputation point
2021-03-08T18:10:03.507+00:00

I have two standard/hot Azure Storage Accounts, SA1 and SA2. SA2 has AD DS enabled, and is joined to the domain. SA1 contains archive data, up to 2-March-2021. SA2 contains archive data, from 2-March-2021 to present. The following situations exist:

  1. Using the command .\azcopy copy 'https://SA1.file.core.windows.net/?sv=2020-02-10&ss=f&srt=sco&sp=rwdlc&se=2021-03-10T04:34:36Z&st=2021-03-02T19:34:36Z&spr=https&sig=REDACTED' 'https://SA2.file.core.windows.net/?sv=2020-02-10&ss=f&srt=sco&sp=rwdlc&se=2021-03-10T04:35:45Z&st=2021-03-02T19:35:45Z&spr=https&sig=REDACTED' --recursive --preserve-smb-info, all file shares are copied from SA1 to SA2 and the Last Modified Date from SA1 is retained. If I then view the properties of a folder within one of the shares on SA2, all files within the folder on SA2 which were copied with the aforementioned command now have an updated Last Modified Date of just a few minutes ago.
  2. Using the command ROBOCOPY \\SA1.file.core.windows.net\share \\SA2.file.core.windows.net\share /S /IS /IT, all share contents are copied from SA1 to SA2 and the Last Modified Date from SA1 is retained. If I then view the properties of a folder within the share on SA2, all files within the folder on SA2 which were copied with the aforementioned command now have an updated Last Modified Date of just a few minutes ago.
  3. Using the command XCOPY /S /F /Y \\SA1.file.core.windows.net\share \\SA2.file.core.windows.net\share, all share contents are copied from SA1 to SA2 and the Last Modified Date from SA1 is retained. If I then view the properties of a folder within the share on SA2, all files within the folder on SA2 which were copied with the aforementioned command retain the Last Modified Date.
  4. Using Windows File Explorer to copy all files from \\SA1.file.core.windows.net\share to \\SA2.file.core.windows.net\share, all share contents are copied from SA1 to SA2 and the Last Modified Date from SA1 is retained. If I then view the properties of a folder within the share on SA2, all files within the folder on SA2 retain the Last Modified Date.

I have also attempted copying the files from within the share on SA2 to a local folder using a C# application and File.Copy method. This too, has the same effect as mentioned in the above four situations.

I have not witnessed this behavior in the previous year on the SA1 storage account, however can consistently reproduce it on the SA2 storage account. We wish to retain the Last Modified Date of the files for ease of research and organization.

What am I doing incorrectly? Did I miss something when I configured the SA2 storage account?

Thanks in advance,

-Lyle

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,162 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,686 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. deherman-MSFT 33,306 Reputation points Microsoft Employee
    2021-03-08T21:45:27.573+00:00

    @Lyle B
    The "preservation" of timestamps isn't really a feature of Azure Files per se, but rather the copy tool (i.e. AzCopy, Robocopy, etc.) that copies the file. When a file is written to disk, the copy tool is responsible for setting timestamps and any other metadata on the file to "preserve" them as desired by the user.

    For AzCopy try explicitly setting --preserve-smb-info=true as outlined here in the docs, it is set to false by default. There is a recent issue created for AzCopy, let me know if you are still seeing this issue and I can make sure to escalate to the AzCopy team. For Robocopy you need to use the /COPY and /DCOPY options to preserve the timestamps. Good discussion on this can be found on this thread.

    Hope this helps! Let me know if you have further questions or need further assistance.

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

    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.