Skip to content

Commit 6eaf6c9

Browse files
Review feedback changes
1 parent 7c95b55 commit 6eaf6c9

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

articles/storage/blobs/storage-blob-copy-python.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,27 @@ This article shows how to copy a blob in a storage account using the [Azure Stor
2020

2121
## About copying blobs
2222

23-
When you copy a blob within a storage account, the copy operation is synchronous. When you copy across storage accounts, it's an asynchronous operation.
24-
25-
The source blob for a copy operation may be a block blob, an append blob, a page blob, a snapshot, or a blob version. If the destination blob already exists, it must be of the same blob type as the source blob. An existing destination blob will be overwritten.
26-
27-
The destination blob can't be modified while a copy operation is in progress. A destination blob can only have one outstanding copy operation. In other words, a blob can't be the destination for multiple pending copy operations.
28-
29-
The entire source blob or file is always copied. Copying a range of bytes or set of blocks isn't supported.
30-
31-
When a blob is copied, its system properties are copied to the destination blob with the same values.
32-
33-
A copy operation can take any of the following forms:
23+
A copy operation can perform any of the following actions:
3424

3525
- Copy a source blob to a destination blob with a different name. The destination blob can be an existing blob of the same blob type (block, append, or page), or can be a new blob created by the copy operation.
3626
- Copy a source blob to a destination blob with the same name, effectively replacing the destination blob. Such a copy operation removes any uncommitted blocks and overwrites the destination blob's metadata.
3727
- Copy a source file in the Azure File service to a destination blob. The destination blob can be an existing block blob, or can be a new block blob created by the copy operation. Copying from files to page blobs or append blobs isn't supported.
3828
- Copy a snapshot over its base blob. By promoting a snapshot to the position of the base blob, you can restore an earlier version of a blob.
3929
- Copy a snapshot to a destination blob with a different name. The resulting destination blob is a writeable blob and not a snapshot.
4030

31+
The source blob for a copy operation may be one of the following types:
32+
- Block blob
33+
- Append blob
34+
- Page blob
35+
- Blob snapshot
36+
- Blob version
37+
38+
If the destination blob already exists, it must be of the same blob type as the source blob. An existing destination blob will be overwritten.
39+
40+
The destination blob can't be modified while a copy operation is in progress. A destination blob can only have one outstanding copy operation. One way to enforce this requirement is to use a blob lease, as shown in the earlier code example. For more information on blob leases, see [Create and manage blob leases with Python](storage-blob-lease-python.md).
41+
42+
The entire source blob or file is always copied. Copying a range of bytes or set of blocks isn't supported. When a blob is copied, its system properties are copied to the destination blob with the same values.
43+
4144
## Copy a blob
4245

4346
To copy a blob, use the following method:
@@ -46,7 +49,7 @@ To copy a blob, use the following method:
4649

4750
This method returns a dictionary containing *copy_status* and *copy_id*, which can be used to check the status of the copy operation. The *copy_status* property will be 'success' if the copy completed synchronously or 'pending' if the copy has been started asynchronously. For asynchronous copies, the status can be checked by polling the `get_blob_properties` method and checking *copy_status*. To force the copy operation to be synchronous, set *requires_sync* to `True`. To learn more about the underlying operation, see [REST API operations](#rest-api-operations).
4851

49-
The following code example gets a `BlobClient` object representing an existing blob and copies it to a new blob in a different container. This example also gets a lease on the source blob before copying so that no other client can modify the blob until the copy is complete and the lease is broken.
52+
The following code example gets a `BlobClient` object representing an existing blob and copies it to a new blob in a different container within the same storage account. This example also gets a lease on the source blob before copying so that no other client can modify the blob until the copy is complete and the lease is broken.
5053

5154
:::code language="python" source="~/azure-storage-snippets/blobs/howto/python/blob-devguide-py/blob-devguide-blobs.py" id="Snippet_copy_blob":::
5255

articles/storage/blobs/storage-blob-lease-python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ A lease creates and manages a lock on a blob for write and delete operations. Th
2222

2323
You can use the Python client library to acquire, renew, release and break leases. Lease operations are handled by the [BlobLeaseClient](/python/api/azure-storage-blob/azure.storage.blob.blobleaseclient) class, which provides a client containing all lease operations for [ContainerClient](/python/api/azure-storage-blob/azure.storage.blob.containerclient) and [BlobClient](/python/api/azure-storage-blob/azure.storage.blob.blobclient). To learn more about lease states and when you might perform an operation, see [Lease states and actions](#lease-states-and-actions).
2424

25-
All container operations are permitted on a container that includes blobs with an active lease, including [Delete Container](/rest/api/storageservices/delete-container). Therefore, a container may be deleted even if blobs within it have active leases. Use the [Lease Container](/rest/api/storageservices/lease-container) operation to control rights to delete a container. To learn more about container leases using the client library, see [Create and manage container leases with Python](storage-blob-container-lease-python.md)
25+
All container operations are permitted on a container that includes blobs with an active lease, including [Delete Container](/rest/api/storageservices/delete-container). Therefore, a container may be deleted even if blobs within it have active leases. Use the [Lease Container](/rest/api/storageservices/lease-container) operation to control rights to delete a container. To learn more about container leases using the client library, see [Create and manage container leases with Python](storage-blob-container-lease-python.md).
2626

2727
## Acquire a lease
2828

0 commit comments

Comments
 (0)