3

In Azure Pipelines, we can upload a file to blob storage using the following task:

- task: AzureFileCopy@4
  inputs:
    SourcePath: 'MyInstaller.tar.gz'
    azureSubscription: 'Azure subscription 1(qwerty)'
    Destination: 'AzureBlob'
    storage: 'qwertyuiop'
    ContainerName: 'qwertyuiop'

I noticed that if the file name is the same, then the file gets overwritten in the container, which is useful, because I can just make my live release pipeline overwrite the file so that users always get the latest version of my software.

However, what happens if a user is currently in the middle of downloading the file and it gets overwritten with a new version? Will the download fail? Is there any documentation from Microsoft on this?

F Chopin
  • 574
  • 7
  • 23
  • Have not got chance to see what happens if version overrites while download but have come across the [similar question](https://stackoverflow.com/questions/7736736/azure-blob-availability-during-an-overwrite). Referenced [document](https://azure.microsoft.com/fr-fr/blog/managing-concurrency-in-microsoft-azure-storage-2/) – kavyaS Oct 18 '21 at 13:19

1 Answers1

0

For block blobs, download may be the older version until the final block commit. Final PutBlockList operation will atomically update the blob to the new version.

For large blobs it may take time to complete the process and so if there is no version change it downloads as is.When there is version change , if any type of concurrency is not set, it will overwrite the data parallely by default and if the version changes and the compatibility doesn’t match there may be internal errors occurring else it downloads.

Please have a look at the reference document on managing concurrency in azure storage which says overwiting depends on access condition.

The Storage service assigns an identifier to every object stored which gets updated every time any change or update happens on that object. The identifier is returned to the client as part of an HTTP GET response using the ETag (entity tag) header that is defined within the HTTP protocol. A user performing an update on such an object can send in the original ETag along with a conditional header to ensure that an update will only occur if a certain condition has been met . The condition is in the form of “If-Match” header which requires to match Etag in update request as in the Storage Service .If certain conditions doesn’t match , the process may get interrupted and return errors .

Reference: azure-blob-availability-during-an-overwrite-SO

kavyaS
  • 8,026
  • 1
  • 7
  • 19