AzCopy – Introducing synchronous copy and customized content type
AzCopy 3.1.0 (Release Version)
- AzCopy by default uses the asynchronous copy mechanism of the storage service to move data between two storage endpoints. As such, the copying of data will run in the background using spare bandwidth capacity that has no SLA in terms of how fast a blob will be copied, and AzCopy will periodically check the copy status until the copying is completed or failed. With the new option /SyncCopy in the 3.1.0 release, the copying of data will get consistent speed. AzCopy does it by downloading the blobs from the source storage endpoint to local memory and then upload them to the destination storage endpoint.
AzCopy /Source:https://myaccount1.blob.core.windows.net/myContainer/ /Dest:https://myaccount2.blob.core.windows.net/myContainer/
/SourceKey:key1 /DestKey:key2 /Pattern:ab /SyncCopy
Note that /SyncCopy might generate additional egress cost comparing to asynchronous copy, the recommended approach is to use this option in the Azure VM which is in the same region as your source storage account to avoid egress cost.
- AzCopy uses “application/octet-stream” as the destination blobs’ content type by default, from version 3.1.0, you can specify the content type via the option /SetContentType:[content-type].
AzCopy /Source:D:\test\ /Dest:https://myaccount.blob.core.windows.net/myContainer/ /DestKey:key /Pattern:ab /SetContentType
AzCopy /Source:D:\test\ /Dest:https://myaccount.blob.core.windows.net/myContainer/ /DestKey:key /Pattern:ab /SetContentType:video/mp4
If "Content-Type" is not specified at the /SetContentType option, AzCopy will set each blob’s content type according to its file extension. To set the same content type for all the blobs, you must explicitly specify a value for “Content-Type", for example, /SetContentType:video/mp4.
Note that this option is only applicable when uploading blobs to the storage end points.
AzCopy 4.1.0-preview (Preview Version)
AzCopy 4.1.0-Preview includes all the features in the release version 3.1.0 and adds the following enhancements:
- User can specify option /SyncCopy in the following scenarios:
- Copying From File storage to Blob storage
- Copying From Blob storage to File storage
- Copying From File storage to File storage
- User can specify destination storage files’ content type.
AzCopy /Source:D:\test\ /Dest:https://myaccount.file.core.windows.net/myContainer/ /DestKey:key /Pattern:ab /SetContentType:video/mp4
Note that this option is only applicable when uploading blobs or files to the storage end points.
As always, we are looking forward to your feedback.
Microsoft Azure Storage Team