1

We have an Azure CDN pointed at blob storage container. We upload on a regular basis new files via AZ Copy.

I can set it in many ways such as https://learn.microsoft.com/nb-no/azure/cdn/cdn-manage-expiration-of-blob-content but not in bulk.

Is it possible to set the Cache-Control property/meta data via AzCopy?

John
  • 29,788
  • 18
  • 89
  • 130

2 Answers2

5

Setting the Cache-Control property is supported in azcopy as of May 2019 https://github.com/Azure/azure-storage-azcopy/releases/tag/v10.1.2

Here's the corresponding release information from the link above:

New features

  1. Headers for Content-Disposition, Content-Language and Cache-Control can now be set when uploading files to Blob Storage and to Azure Files. Run azcopy copy --help to see command line parameter information, including those needed to set the new headers.
ZiGaelle
  • 744
  • 1
  • 9
  • 21
Tania
  • 66
  • 1
  • 4
  • 2
    [links](https://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links-elsewhere-really-good-answers) can break and change over time. Please provide the relevant information here. – LuckyLikey Jul 24 '19 at 06:54
  • 1
    Why won't you just write out the commands instead of telling us to go to to azcopy --help ? – Poul K. Sørensen Apr 18 '20 at 16:01
  • 3
    From CLI help: `--cache-control string Set the cache-control header. Returned on download.` – Monsignor Oct 07 '20 at 12:10
1

Looking at the AzCopy parameters documentation, it does not appear you can set the Cache-Control property.

However, the Azure Data Movement Library exposes a SetAttributesCallback which would allow you to set properties.

Don Lockhart
  • 894
  • 5
  • 12
  • That is where I got to. In the end wrote a console app based on the code here: http://stackoverflow.com/a/26319001/33 – John Mar 31 '17 at 15:02