From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function AcquireBlobLease(ContainerName, BlobName: string; out LeaseId: string;  ResponseInfo: TCloudResponseInfo = nil; LeaseDuration: Integer = -1): Boolean;


bool __fastcall AcquireBlobLease(System::UnicodeString ContainerName, System::UnicodeString BlobName, /* out */ System::UnicodeString &LeaseId, Data::Cloud::Cloudapi::TCloudResponseInfo* ResponseInfo = (Data::Cloud::Cloudapi::TCloudResponseInfo*)(0x0), int LeaseDuration = 0xffffffff);


Type Visibility Source Unit Parent
function public
Data.Cloud.AzureAPI TAzureBlobService


Attempts to acquire a lease on the specified blob.

You cannot acquire a lease for a snapshot.

AcquireBlobLease accepts the following parameters:

  • <ContainerName>: The name of the container that the blob is in.
  • <BlobName>: The name of the blob to acquire a lease for.
  • <LeaseId>: The acquired lease ID, or empty string if failed.
  • <ResponseInfo>: Optional. The class for storing response info into. Default is nil.
  • <LeaseDuration>: Optional. The duration of the lease in seconds. A lease establishes and manages a lock on a blob for write and delete operations. Default is -1, which is a flag for infinite lease. Valid values are between 15 and 60.

The method returns True if the lease was acquired, and False otherwise.

See Microsoft Azure - Lease Blob for more information about the <LeaseDuration>.

See Also