-
Notifications
You must be signed in to change notification settings - Fork 222
AzCopy Set Properties
Mohit Sharma edited this page Jul 4, 2022
·
2 revisions
AzCopy supports setting properties on the given location (Blob, File, ADLS Gen2) from release 10.16.0 onwards.
At present, we support setting following properties :-
azcopy setprops "https://[account].blob.core.windows.net/[container]/[path/to/blob]" --block-blob-tier=[Hot/Cool/Archive]--rehydrate-priority=[Standard/High]
azcopy setprops "https://[account].blob.core.windows.net/[container]/[path/to/blob]" --page-blob-tier=[P10/P15/P20/P30/P4/P40/P50/P6]--rehydrate-priority=[Standard/High]
azcopy setprops "https://[account].blob.core.windows.net/[container]/[path/to/directory]" --recursive --block-blob-tier=[Hot/Cool/Archive]--rehydrate-priority=[Standard/High]
Note:
- A blob in the Archive tier is offline — that is, it cannot be read or modified — until it is rehydrated. The rehydration process can take several hours and has associated costs. Please read the public documentation before proceeding.
- The default rehydration priority is set to STANDARD.
- If you are using DFS endpoint, it will be replaced by equivalent blob endpoints.
To learn more, refer to the public documentations here :-
- Overview of Blob access tiers
- Set a blob's access tier
- Archive a blob, Blob rehydration from the Archive tier
- Rehydrate an archived blob to an online tier
Changing Blob Index Tags
azcopy setprops "https://[account].blob.core.windows.net/[container]/[path/to/blob]" --blob-tags=abc=def&ghi=jkl
azcopy setprops "https://[account].blob.core.windows.net/[container]/[path/to/directory]" --recursive --blob-tags=abc=def&ghi=jkl
Removing Blob Index Tags
azcopy setprops "https://[account].blob.core.windows.net/[container]/[path/to/blob]" --blob-tags=clear
azcopy setprops "https://[account].blob.core.windows.net/[container]/[path/to/directory]" --recursive --blob-tags=clear
Note:
- Blob tags are a property of blobs only. So when setting blob tags, location must always be Blob / ADLS Gen2.
- If you are using DFS endpoint, it will be replaced by equivalent blob endpoints.
- Keys and values are URL encoded and the key-value pairs are separated by an ampersand('&')
- Setting blob index tags can be performed by the Storage Blob Data Owner and by anyone with a Shared Access Signature that has permission to access the blob's tags (the t SAS permission).
- In addition, RBAC users with the Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/write permission can perform this operation.
- Caution: AzCopy does not append blob-tags to existing blob-tags. The default behaviour is to clear the existing blob-tags and apply the provided blob-tags.
azcopy setprops "https://[account].blob.core.windows.net/[container]/[path/to/blob]" --metadata=abc=def;ghi=jkl
To recursively change the metadata of all files in a directory to {key = "abc", val = "def"} and {key = "ghi", val = "jkl"}
azcopy setprops "https://[account].blob.core.windows.net/[container]/[path/to/virtual/dir]" --recursive --metadata=abc=def;ghi=jkl
azcopy setprops "https://[account].blob.core.windows.net/[container]/[path/to/blob]" --metadata=clear
azcopy setprops "https://[account].blob.core.windows.net/[container]/[path/to/blob]" --recursive --metadata=clear
Note:
- Metadata follows C# based naming convention.
- Setting and retrieving properties and metadata for Blob service resources
- Caution: AzCopy does not append metadata to existing metadata. The default behaviour is to clear the existing metadata and apply the given metadata.