Reputation: 132
I'm trying to upload a file to an Azure Blob storage using AzCopy, but I want to include metadata. According to the documentation, "AzCopy copy" has a metadata parameter where I have to provide key/value pairs as a string. How has this string to be formatted? I can't get it to work and don't find any examples...
AzCopy.exe copy .\testfile2.txt "https://storageaccount.blob.core.windows.net/upload/testfile4.txt?sastoken" --metadata ?what_here?
Thanks!
Documentation: https://learn.microsoft.com/en-us/azure/storage/common/storage-ref-azcopy-copy#options
Upvotes: 2
Views: 3758
Reputation: 29995
The string should be in this format: --metadata "name=ivan"
.
If you want to add multi metadata, use this format: --metadata "name=ivan;city=tokyo"
This is the command I'm using, and the version of azcopy is 10.3.4
:
azcopy copy "file_path" "https://xxx.blob.core.windows.net/test1/aaa1.txt?sasToken" --metadata "name=ivan"
The test result:
Upvotes: 5