2020-10-12 11:53:17 +08:00
|
|
|
# azcopy
|
|
|
|
|
|
|
|
> A file transfer tool for uploading to Azure Cloud Storage Accounts.
|
2022-10-04 20:36:23 +05:30
|
|
|
> More information: <https://learn.microsoft.com/azure/storage/common/storage-use-azcopy-v10>.
|
2020-10-12 11:53:17 +08:00
|
|
|
|
2021-05-14 02:42:15 +02:00
|
|
|
- Log in to an Azure Tenant:
|
2020-10-12 11:53:17 +08:00
|
|
|
|
|
|
|
`azopy login`
|
|
|
|
|
|
|
|
- Upload a local file:
|
|
|
|
|
2023-02-20 17:23:49 +10:00
|
|
|
`azcopy copy '{{path\to\source_file}}' 'https://{{storage_account_name}}.blob.core.windows.net/{{container_name}}/{{blob_name}}'`
|
2020-10-12 11:53:17 +08:00
|
|
|
|
|
|
|
- Upload files with `.txt` and `.jpg` extensions:
|
|
|
|
|
2023-02-20 17:23:49 +10:00
|
|
|
`azcopy copy '{{path\to\source_directory}}' 'https://{{storage_account_name}}.blob.core.windows.net/{{container_name}}' --include-pattern '{{*.txt;*.jpg}}'`
|
2020-10-12 11:53:17 +08:00
|
|
|
|
|
|
|
- Copy a container directly between two Azure storage accounts:
|
|
|
|
|
2020-11-01 14:40:05 +01:00
|
|
|
`azcopy copy 'https://{{source_storage_account_name}}.blob.core.windows.net/{{container_name}}' 'https://{{destination_storage_account_name}}.blob.core.windows.net/{{container_name}}'`
|
2020-10-12 11:53:17 +08:00
|
|
|
|
2020-10-24 16:28:11 +03:30
|
|
|
- Synchronize a local directory and delete files in the destination if they no longer exist in the source:
|
2020-10-12 11:53:17 +08:00
|
|
|
|
2023-02-20 17:23:49 +10:00
|
|
|
`azcopy sync '{{path\to\source_directory}}' 'https://{{storage_account_name}}.blob.core.windows.net/{{container_name}}' --recursive --delete-destination=true`
|
2020-10-12 11:53:17 +08:00
|
|
|
|
2024-01-30 01:55:24 -03:00
|
|
|
- Display help:
|
2020-10-12 11:53:17 +08:00
|
|
|
|
|
|
|
`azcopy --help`
|