Skip to content

Commit adf9dfb

Browse files
Edits for consistency
1 parent 9935f7f commit adf9dfb

8 files changed

+80
-40
lines changed

articles/storage/blobs/storage-blob-container-lease-java.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,19 @@ ms.custom: devx-track-java, devguide-java
1616

1717
# Create and manage container leases with Java
1818

19-
This article shows how to create and manage container leases using the [Azure Storage client library for Java](/java/api/overview/azure/storage-blob-readme).
19+
This article shows how to create and manage container leases using the [Azure Storage client library for Java](/java/api/overview/azure/storage-blob-readme). You can use the client library to acquire, renew, release, and break blob leases.
2020

21-
A lease establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. A lease on a container provides exclusive delete access to the container. A container lease only controls the ability to delete the container using the [Delete Container](/rest/api/storageservices/delete-container) operation. To delete a container with an active lease, a client must include the active lease ID with the delete request. All other container operations will succeed on a leased container without the lease ID. If you've enabled [container soft delete](soft-delete-container-overview.md), you can restore deleted containers.
21+
## About container leases
2222

23-
You can use the Java client library to acquire, renew, release and break leases. Lease operations are handled by the [BlobLeaseClient](/java/api/com.azure.storage.blob.specialized.blobleaseclient) class, which provides a client containing all lease operations for [BlobContainerClient](/java/api/com.azure.storage.blob.blobcontainerclient) and [BlobClient](/java/api/com.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).
23+
[!INCLUDE [storage-dev-guide-about-container-lease](../../../includes/storage-dev-guides/storage-dev-guide-about-container-lease.md)]
24+
25+
Lease operations are handled by the [BlobLeaseClient](/java/api/com.azure.storage.blob.specialized.blobleaseclient) class, which provides a client containing all lease operations for blobs and containers. To learn more about blob leases using the client library, see [Create and manage blob leases with Java](storage-blob-lease-java.md).
2426

2527
## Acquire a lease
2628

27-
When you acquire a lease, you'll obtain a lease ID that your code can use to operate on the container. To acquire a lease, create an instance of the [BlobLeaseClient](/java/api/com.azure.storage.blob.specialized.blobleaseclient) class, and then use the following method:
29+
When you acquire a container lease, you obtain a lease ID that your code can use to operate on the container. If the container already has an active lease, you can only request a new lease by using the active lease ID. However, you can specify a new lease duration.
30+
31+
To acquire a lease, create an instance of the [BlobLeaseClient](/java/api/com.azure.storage.blob.specialized.blobleaseclient) class, and then use the following method:
2832

2933
- [acquireLease](/java/api/com.azure.storage.blob.specialized.blobleaseclient)
3034

@@ -34,7 +38,9 @@ The following example acquires a 30-second lease for a container:
3438

3539
## Renew a lease
3640

37-
If your lease expires, you can renew it. To renew an existing lease, use the following method:
41+
You can renew a container lease if the lease ID specified on the request matches the lease ID associated with the container. The lease can be renewed even if it has expired, as long as the container hasn't been leased again since the expiration of that lease. When you renew a lease, the duration of the lease resets.
42+
43+
To renew an existing lease, use the following method:
3844

3945
- [renewLease](/java/api/com.azure.storage.blob.specialized.blobleaseclient)
4046

@@ -44,7 +50,9 @@ The following example renews a lease for a container:
4450

4551
## Release a lease
4652

47-
You can either wait for a lease to expire or explicitly release it. When you release a lease, other clients can immediately acquire a lease for the container as soon as the operation is complete. You can release a lease by using the following method:
53+
You can release a container lease if the lease ID specified on the request matches the lease ID associated with the container. Releasing a lease allows another client to acquire a lease for the container immediately after the release is complete.
54+
55+
You can release a lease by using the following method:
4856

4957
- [releaseLease](/java/api/com.azure.storage.blob.specialized.blobleaseclient)
5058

@@ -54,7 +62,9 @@ The following example releases the lease on a container:
5462

5563
## Break a lease
5664

57-
When you break a lease, the lease ends, and other clients can't acquire a lease until the lease period expires. You can break a lease by using the following method:
65+
You can break a container lease if the container has an active lease. Any authorized request can break the lease; the request isn't required to specify a matching lease ID. A lease can't be renewed after it's broken, and breaking a lease prevents a new lease from being acquired for a period of time until the original lease expires or is released.
66+
67+
You can break a lease by using the following method:
5868

5969
- [breakLease](/java/api/com.azure.storage.blob.specialized.blobleaseclient)
6070

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

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,19 @@ ms.custom: devx-track-python, devguide-python
1616

1717
# Create and manage container leases with Python
1818

19-
This article shows how to create and manage container leases using the [Azure Storage client library for Python](/python/api/overview/azure/storage). You can use the Python client library to acquire, renew, release and break container leases.
19+
This article shows how to create and manage container leases using the [Azure Storage client library for Python](/python/api/overview/azure/storage). You can use the client library to acquire, renew, release and break container leases.
2020

21-
A lease establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. A lease on a container provides exclusive delete access to the container. A container lease only controls the ability to delete the container using the [Delete Container](/rest/api/storageservices/delete-container) REST API operation. To delete a container with an active lease, a client must include the active lease ID with the delete request. All other container operations will succeed on a leased container without the lease ID. If you've enabled [container soft delete](soft-delete-container-overview.md), you can restore deleted containers.
21+
## About container leases
2222

23-
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).
23+
[!INCLUDE [storage-dev-guide-about-container-lease](../../../includes/storage-dev-guides/storage-dev-guide-about-container-lease.md)]
24+
25+
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 blobs and containers. To learn more about blob leases using the client library, see [Create and manage blob leases with Python](storage-blob-lease-python.md).
2426

2527
## Acquire a lease
2628

27-
When you acquire a lease, you'll obtain a lease ID that your code can use to operate on the container. To acquire a lease, create an instance of the [BlobLeaseClient](/python/api/azure-storage-blob/azure.storage.blob.blobleaseclient) class, and then use the following method:
29+
When you acquire a container lease, you obtain a lease ID that your code can use to operate on the container. If the container already has an active lease, you can only request a new lease by using the active lease ID. However, you can specify a new lease duration.
30+
31+
To acquire a lease, create an instance of the [BlobLeaseClient](/python/api/azure-storage-blob/azure.storage.blob.blobleaseclient) class, and then use the following method:
2832

2933
- [BlobLeaseClient.acquire](/python/api/azure-storage-blob/azure.storage.blob.blobleaseclient#azure-storage-blob-blobleaseclient-acquire)
3034

@@ -38,7 +42,9 @@ The following example acquires a 30-second lease on a container:
3842

3943
## Renew a lease
4044

41-
If your lease expires, you can renew it. To renew a lease, use the following method:
45+
You can renew a container lease if the lease ID specified on the request matches the lease ID associated with the container. The lease can be renewed even if it has expired, as long as the container hasn't been leased again since the expiration of that lease. When you renew a lease, the duration of the lease resets.
46+
47+
To renew a lease, use the following method:
4248

4349
- [BlobLeaseClient.renew](/python/api/azure-storage-blob/azure.storage.blob.blobleaseclient#azure-storage-blob-blobleaseclient-renew)
4450

@@ -48,7 +54,9 @@ The following example renews a lease for a container:
4854

4955
## Release a lease
5056

51-
You can either wait for a lease to expire or explicitly release it. When you release a lease, other clients can obtain a lease. You can release a lease by using the following method:
57+
You can release a container lease if the lease ID specified on the request matches the lease ID associated with the container. Releasing a lease allows another client to acquire a lease for the container immediately after the release is complete.
58+
59+
You can release a lease by using the following method:
5260

5361
- [BlobLeaseClient.release](/python/api/azure-storage-blob/azure.storage.blob.blobleaseclient#azure-storage-blob-blobleaseclient-release)
5462

@@ -58,7 +66,9 @@ The following example releases the lease on a container:
5866

5967
## Break a lease
6068

61-
When you break a lease, the lease ends, but other clients can't acquire a lease until the lease period expires. You can break a lease by using the following method:
69+
You can break a container lease if the container has an active lease. Any authorized request can break the lease; the request isn't required to specify a matching lease ID. A lease can't be renewed after it's broken, and breaking a lease prevents a new lease from being acquired for a period of time until the original lease expires or is released.
70+
71+
You can break a lease by using the following method:
6272

6373
- [BlobLeaseClient.break_lease](/python/api/azure-storage-blob/azure.storage.blob.blobleaseclient#azure-storage-blob-blobleaseclient-break-lease)
6474

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,19 @@ ms.custom: devx-track-csharp, devguide-csharp
1616

1717
# Create and manage container leases with .NET
1818

19-
This article shows how to create and manage container leases using the [Azure Storage client library for .NET](/dotnet/api/overview/azure/storage). You can use the .NET client library to acquire, renew, release, and break container leases.
19+
This article shows how to create and manage container leases using the [Azure Storage client library for .NET](/dotnet/api/overview/azure/storage). You can use the client library to acquire, renew, release, and break container leases.
2020

2121
## About container leases
2222

2323
[!INCLUDE [storage-dev-guide-about-container-lease](../../../includes/storage-dev-guides/storage-dev-guide-about-container-lease.md)]
2424

25-
To learn more about blob leases using the client library, see [Create and manage blob leases with .NET](storage-blob-lease.md).
25+
Lease operations are handled by the [BlobLeaseClient](/dotnet/api/azure.storage.blobs.specialized.blobleaseclient) class, which provides a client containing all lease operations for blobs and containers. To learn more about blob leases using the client library, see [Create and manage blob leases with .NET](storage-blob-lease.md).
2626

2727
## Acquire a lease
2828

29-
When you acquire a container lease, you obtain a lease ID that your code can use to operate on the container. If the container already has an active lease, you can only request a new lease by using the active lease ID. However, you can specify a new lease duration. To acquire a lease, create an instance of the [BlobLeaseClient](/dotnet/api/azure.storage.blobs.specialized.blobleaseclient) class, and then use one of the following methods:
29+
When you acquire a container lease, you obtain a lease ID that your code can use to operate on the container. If the container already has an active lease, you can only request a new lease by using the active lease ID. However, you can specify a new lease duration.
30+
31+
To acquire a lease, create an instance of the [BlobLeaseClient](/dotnet/api/azure.storage.blobs.specialized.blobleaseclient) class, and then use one of the following methods:
3032

3133
- [Acquire](/dotnet/api/azure.storage.blobs.specialized.blobleaseclient.acquire)
3234
- [AcquireAsync](/dotnet/api/azure.storage.blobs.specialized.blobleaseclient.acquireasync)
@@ -68,7 +70,7 @@ You can break a container lease if the container has an active lease. Any author
6870
You can break a lease using one of the following methods on a [BlobLeaseClient](/dotnet/api/azure.storage.blobs.specialized.blobleaseclient) instance:
6971

7072
- [Break](/dotnet/api/azure.storage.blobs.specialized.blobleaseclient.break)
71-
- [BreakAsync](/dotnet/api/azure.storage.blobs.specialized.blobleaseclient.breakasync);
73+
- [BreakAsync](/dotnet/api/azure.storage.blobs.specialized.blobleaseclient.breakasync)
7274

7375
The following example breaks a lease on a container:
7476

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,19 @@ ms.custom: devx-track-java, devguide-java
1616

1717
# Create and manage blob leases with Java
1818

19-
This article shows how to create and manage blob leases using the [Azure Storage client library for Java](/java/api/overview/azure/storage-blob-readme).
19+
This article shows how to create and manage blob leases using the [Azure Storage client library for Java](/java/api/overview/azure/storage-blob-readme). You can use the client library to acquire, renew, release, and break blob leases.
2020

21-
A lease creates and manages a lock on a blob for write and delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. A lease on a blob provides exclusive write and delete access to the blob. To write to a blob with an active lease, a client must include the active lease ID with the write request.
21+
## About blob leases
2222

23-
You can use the Java client library to acquire, renew, release and break leases. Lease operations are handled by the [BlobLeaseClient](/java/api/com.azure.storage.blob.specialized.blobleaseclient) class, which provides a client containing all lease operations for [BlobContainerClient](/java/api/com.azure.storage.blob.blobcontainerclient) and [BlobClient](/java/api/com.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).
23+
[!INCLUDE [storage-dev-guide-about-blob-lease](../../../includes/storage-dev-guides/storage-dev-guide-about-blob-lease.md)]
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 Java](storage-blob-container-lease-java.md)
25+
Lease operations are handled by the [BlobLeaseClient](/java/api/com.azure.storage.blob.specialized.blobleaseclient) class, which provides a client containing all lease operations for blobs and containers. To learn more about container leases using the client library, see [Create and manage container leases with Java](storage-blob-container-lease-java.md).
2626

2727
## Acquire a lease
2828

29-
When you acquire a lease, you'll obtain a lease ID that your code can use to operate on the blob. To acquire a lease, create an instance of the [BlobLeaseClient](/java/api/com.azure.storage.blob.specialized.blobleaseclient) class, and then use the following method:
29+
When you acquire a blob lease, you obtain a lease ID that your code can use to operate on the blob. If the blob already has an active lease, you can only request a new lease by using the active lease ID. However, you can specify a new lease duration.
30+
31+
To acquire a lease, create an instance of the [BlobLeaseClient](/java/api/com.azure.storage.blob.specialized.blobleaseclient) class, and then use the following method:
3032

3133
- [acquireLease](/java/api/com.azure.storage.blob.specialized.blobleaseclient)
3234

@@ -36,7 +38,9 @@ The following example acquires a 30-second lease for a blob:
3638

3739
## Renew a lease
3840

39-
If your lease expires, you can renew it. To renew an existing lease, use the following method:
41+
You can renew a blob lease if the lease ID specified on the request matches the lease ID associated with the blob. The lease can be renewed even if it has expired, as long as the blob hasn't been modified or leased again since the expiration of that lease. When you renew a lease, the duration of the lease resets.
42+
43+
To renew an existing lease, use the following method:
4044

4145
- [renewLease](/java/api/com.azure.storage.blob.specialized.blobleaseclient)
4246

@@ -46,7 +50,9 @@ The following example renews a lease for a blob:
4650

4751
## Release a lease
4852

49-
You can either wait for a lease to expire or explicitly release it. When you release a lease, other clients can immediately acquire a lease for the blob as soon as the operation is complete. You can release a lease by using the following method:
53+
You can release a blob lease if the lease ID specified on the request matches the lease ID associated with the blob. Releasing a lease allows another client to acquire a lease for the blob immediately after the release is complete.
54+
55+
You can release a lease by using the following method:
5056

5157
- [releaseLease](/java/api/com.azure.storage.blob.specialized.blobleaseclient)
5258

@@ -56,7 +62,9 @@ The following example releases the lease on a blob:
5662

5763
## Break a lease
5864

59-
When you break a lease, the lease ends, and other clients can't acquire a lease until the lease period expires. You can break a lease by using the following method:
65+
You can break a blob lease if the blob has an active lease. Any authorized request can break the lease; the request isn't required to specify a matching lease ID. A lease can't be renewed after it's broken, and breaking a lease prevents a new lease from being acquired for a period of time until the original lease expires or is released.
66+
67+
You can break a lease by using the following method:
6068

6169
- [breakLease](/java/api/com.azure.storage.blob.specialized.blobleaseclient)
6270

0 commit comments

Comments
 (0)