Skip to content

Commit 1a2c403

Browse files
authored
Merge pull request #213497 from normesta/azcopy
Updating guidelines for better visibility
2 parents 7373183 + bcaf89d commit 1a2c403

File tree

5 files changed

+47
-24
lines changed

5 files changed

+47
-24
lines changed

articles/storage/common/storage-ref-azcopy-copy.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ description: This article provides reference information for the azcopy copy com
44
author: normesta
55
ms.service: storage
66
ms.topic: reference
7-
ms.date: 05/26/2022
7+
ms.date: 10/22/2022
88
ms.author: normesta
99
ms.subservice: common
1010
ms.reviewer: zezha-msft
1111
---
1212

1313
# azcopy copy
1414

15-
Copies source data to a destination location.
15+
Copies source data to a destination location.
16+
1617

1718
## Synopsis
1819

@@ -48,6 +49,12 @@ If you set an environment variable by using the command line, that variable will
4849
azcopy copy [source] [destination] [flags]
4950
```
5051

52+
## Related conceptual articles
53+
54+
- [Get started with AzCopy](storage-use-azcopy-v10.md)
55+
- [Transfer data with AzCopy and Blob storage](./storage-use-azcopy-v10.md#transfer-data)
56+
- [Transfer data with AzCopy and file storage](storage-use-azcopy-files.md)
57+
5158
## Examples
5259

5360
Upload a single file by using OAuth authentication. If you haven't yet logged into AzCopy, please run the azcopy login command before you run the following command.
@@ -237,7 +244,7 @@ Copy a subset of buckets by using a wildcard symbol (*) in the bucket name from
237244

238245
`--content-type` (string) Specifies the content type of the file. Implies no-guess-mime-type. Returned on download.
239246

240-
`--cpk-by-name` (string) Client provided key by name that lets clients making requests against Azure Blob storage an option to provide an encryption key on a per-request basis. Provided key name will be fetched from Azure Key Vault and will be used to encrypt the data
247+
`--cpk-by-name` (string) Client provided key by name that gives clients making requests against Azure Blob storage an option to provide an encryption key on a per-request basis. Provided key name will be fetched from Azure Key Vault and will be used to encrypt the data
241248

242249
`--cpk-by-value` Client provided key by name that let clients making requests against Azure Blob storage an option to provide an encryption key on a per-request basis. Provided key and its hash will be fetched from environment variables
243250

articles/storage/common/storage-ref-azcopy-sync.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ The sync command differs from the copy command in several ways:
2929
2. When syncing between virtual directories, add a trailing slash to the path (refer to examples) if there's a blob with the same name as one of the virtual directories.
3030
3. If the 'delete-destination' flag is set to true or prompt, then sync will delete files and blobs at the destination that aren't present at the source.
3131

32-
Advanced:
32+
## Guidelines
33+
34+
[!INCLUDE [Azcopy sync command general guidelines](../../../includes/azure-storage-azcopy-sync-guidelines.md)]
35+
36+
- For Blob Storage, you can prevent accidental deletions by making sure to enable the [soft delete](../blobs/soft-delete-blob-overview.md) feature before you use the `--delete-destination=prompt|true` flag.
37+
38+
## Advanced
3339

3440
Note that if you don't specify a file extension, AzCopy automatically detects the content type of the files when uploading from the local disk, based on the file extension or content.
3541

@@ -48,6 +54,12 @@ the header field Last-Modified is used instead of x-ms-file-change-time, which m
4854
azcopy sync [flags]
4955
```
5056

57+
## Related conceptual articles
58+
59+
- [Get started with AzCopy](storage-use-azcopy-v10.md)
60+
- [Transfer data with AzCopy and Blob storage](./storage-use-azcopy-v10.md#transfer-data)
61+
- [Transfer data with AzCopy and file storage](storage-use-azcopy-files.md)
62+
5163
## Examples
5264

5365
Sync a single file:

articles/storage/common/storage-use-azcopy-blobs-synchronize.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: This article contains a collection of AzCopy example commands that
44
author: normesta
55
ms.service: storage
66
ms.topic: how-to
7-
ms.date: 04/02/2021
7+
ms.date: 10/02/2022
88
ms.author: normesta
99
ms.subservice: common
1010
ms.reviewer: dineshm
@@ -32,17 +32,10 @@ See the [Get started with AzCopy](storage-use-azcopy-v10.md) article to download
3232
3333
## Guidelines
3434

35-
- The [sync](storage-ref-azcopy-sync.md) command compares file names and last modified timestamps. Set the `--delete-destination` optional flag to a value of `true` or `prompt` to delete files in the destination directory if those files no longer exist in the source directory.
36-
37-
- If you set the `--delete-destination` flag to `true`, AzCopy deletes files without providing a prompt. If you want a prompt to appear before AzCopy deletes a file, set the `--delete-destination` flag to `prompt`.
38-
39-
- If you plan to set the `--delete-destination` flag to `prompt` or `false`, consider using the [copy](storage-ref-azcopy-copy.md) command instead of the
40-
[sync](storage-ref-azcopy-sync.md) command and set the `--overwrite` parameter to `ifSourceNewer`. The [copy](storage-ref-azcopy-copy.md) command consumes less memory and incurs less billing costs because a copy operation doesn't have to index the source or destination prior to moving files.
35+
[!INCLUDE [Azcopy sync command general guidelines](../../../includes/azure-storage-azcopy-sync-guidelines.md)]
4136

4237
- To prevent accidental deletions, make sure to enable the [soft delete](../blobs/soft-delete-blob-overview.md) feature before you use the `--delete-destination=prompt|true` flag.
4338

44-
- The machine on which you run the sync command should have an accurate system clock because the last modified times are critical in determining whether a file should be transferred. If your system has significant clock skew, avoid modifying files at the destination too close to the time that you plan to run a sync command.
45-
4639
## Update a container with changes to a local file system
4740

4841
In this case, the container is the destination, and the local file system is the source.
@@ -79,7 +72,7 @@ azcopy sync 'https://mystorageaccount.blob.core.windows.net/mycontainer' 'C:\myD
7972

8073
## Update a container with changes in another container
8174

82-
The first container that appears in this command is the source. The second one is the destination. Make sure to append a a SAS token to each source URL.
75+
The first container that appears in this command is the source. The second one is the destination. Make sure to append a SAS token to each source URL.
8376

8477
If you provide authorization credentials by using Azure Active Directory (Azure AD), you can omit the SAS token only from the destination URL. Make sure that you've set up the proper roles in your destination account. See [Option 1: Use Azure Active Directory](storage-use-azcopy-v10.md?toc=/azure/storage/blobs/toc.json#option-1-use-azure-active-directory).
8578

@@ -98,7 +91,7 @@ azcopy sync 'https://mysourceaccount.blob.core.windows.net/mycontainer?sv=2018-0
9891

9992
## Update a directory with changes to a directory in another container
10093

101-
The first directory that appears in this command is the source. The second one is the destination. Make sure to append a a SAS token to each source URL.
94+
The first directory that appears in this command is the source. The second one is the destination. Make sure to append a SAS token to each source URL.
10295

10396
If you provide authorization credentials by using Azure Active Directory (Azure AD), you can omit the SAS token only from the destination URL. Make sure that you've set up the proper roles in your destination account. See [Option 1: Use Azure Active Directory](storage-use-azcopy-v10.md?toc=/azure/storage/blobs/toc.json#option-1-use-azure-active-directory).
10497

articles/storage/common/storage-use-azcopy-files.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Transfer data with AzCopy and file storage. AzCopy is a command-lin
44
author: normesta
55
ms.service: storage
66
ms.topic: how-to
7-
ms.date: 09/29/2022
7+
ms.date: 10/02/2022
88
ms.author: normesta
99
ms.subservice: common
1010
---
@@ -425,14 +425,7 @@ You can synchronize the contents of a local file system with a file share or syn
425425
426426
### Guidelines
427427

428-
- The [sync](storage-ref-azcopy-sync.md) command compares file names and last modified timestamps. Set the `--delete-destination` optional flag to a value of `true` or `prompt` to delete files in the destination directory if those files no longer exist in the source directory.
429-
430-
- If you set the `--delete-destination` flag to `true`, AzCopy deletes files without providing a prompt. If you want a prompt to appear before AzCopy deletes a file, set the `--delete-destination` flag to `prompt`.
431-
432-
- If you plan to set the `--delete-destination` flag to `prompt` or `false`, consider using the [copy](storage-ref-azcopy-copy.md) command instead of the
433-
[sync](storage-ref-azcopy-sync.md) command and set the `--overwrite` parameter to `ifSourceNewer`. The [copy](storage-ref-azcopy-copy.md) command consumes less memory and incurs less billing costs because a copy operation doesn't have to index the source or destination prior to moving files.
434-
435-
- The machine on which you run the sync command should have an accurate system clock because the last modified times are critical in determining whether a file should be transferred. If your system has significant clock skew, avoid modifying files at the destination too close to the time that you plan to run a sync command.
428+
[!INCLUDE [Azcopy sync command general guidelines](../../../includes/azure-storage-azcopy-sync-guidelines.md)]
436429

437430
> [!TIP]
438431
> You can tweak your sync operation by using optional flags. Here's a few examples.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
author: normesta
3+
ms.service: storage
4+
ms.topic: include
5+
ms.date: 10/03/2022
6+
ms.author: normesta
7+
---
8+
9+
The [sync](../articles/storage/common/storage-ref-azcopy-sync.md) command compares file names and last modified timestamps. Set the `--delete-destination` optional flag to a value of `true` or `prompt` to delete files in the destination directory if those files no longer exist in the source directory.
10+
11+
- If you set the `--delete-destination` flag to `true`, AzCopy deletes files without providing a prompt. If you want a prompt to appear before AzCopy deletes a file, set the `--delete-destination` flag to `prompt`.
12+
13+
- If you plan to set the `--delete-destination` flag to `prompt` or `false`, consider using the [copy](../articles/storage/common/storage-ref-azcopy-copy.md) command instead of the
14+
[sync](../articles/storage/common/storage-ref-azcopy-sync.md) command and set the `--overwrite` parameter to `ifSourceNewer`. The [copy](../articles/storage/common/storage-ref-azcopy-copy.md) command consumes less memory and incurs less billing costs because a copy operation doesn't have to index the source or destination prior to moving files.
15+
16+
- The machine on which you run the sync command should have an accurate system clock because the last modified times are critical in determining whether a file should be transferred. If your system has significant clock skew, avoid modifying files at the destination too close to the time that you plan to run a sync command.
17+
18+
- AzCopy uses server-to-server APIs to synchronize data between storage accounts. That means that data is copied directly between storage servers. However, AzCopy does set up and monitor each transfer, and for larger storage accounts (For example, accounts that contain millions of blobs), AzCopy might require a substantial amount of compute resources to accomplish these tasks. Therefore, if you are running AzCopy from Virtual Machine (VM), make sure that the VM has enough cores/memory to handle the load.

0 commit comments

Comments
 (0)