az storage blob upload-batch but ignore duplicate files

Joe S 21 Reputation points
2020-09-10T14:16:19.91+00:00

I'm using the following command to upload the build output of a static website to and Azure blob storage

az storage blob upload-batch --account-name $(STORAGE_NAME) --account-key $(STORAGE_KEY) -d '$web' -s .\public\

This works well, but uploads many of the same images and assets that already exist in the storage container from the previous builds. Is there a way to ignore or filter out content that hasn't changed so that I would only upload the new files and assets?

Thanks in advance for any replies!

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,714 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,436 questions
0 comments No comments
{count} votes

Accepted answer
  1. deherman-MSFT 33,626 Reputation points Microsoft Employee
    2020-09-10T16:57:07.197+00:00

    @Joe S
    You can use --if-unmodified-since to accomplish this. You can set an older date if you do not wish to overwrite any of the existing files. Please refer to the first example under upload-batch here.

    I hope this helps. Let us know if you have further questions or issues.

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

    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