Azure File Share - Prevent Consumer Access During StartCopyAsync

Viewed 133

I am attempting to copy a file to Azure File Share via .Net Storage client (v12) for an integration.

The plan is copy file from Azure Storage to Azure File Share in the same account. That works fine.

I am using the StartCopyAsync method and it works as expected during testing.

However, for the live integration, the consumer is reading the file during the copy operation with zero bytes. The consumer then deletes the file. However, they have accessed and copied deleted the file before it was complete. Is there anything I can do to prevent access to the file during copy operation?

They have the file share mounted an SMB share and monitored and BizTalk is just seeing the file instantly.

Options looked at:

  1. Uploading file and renaming - Azure File Share doesn't seem to support rename?
  2. Uploading Marked ReadOnly and Hidden. SMB doesn't care if the file is ReadOnly and the other part of integration can't change to ignore hidden files
  3. Take File Lease - To prevent deletion - still has the problem of client reading the empty file as soon as it hits the file share

Something else?

0 Answers
Related