Share via


ShareLeaseClient.ReleaseAsync(CancellationToken) Method

Definition

The ReleaseAsync(CancellationToken) operation releases the files's previously-acquired lease.

The lease may be released if the LeaseId matches that associated with the file. Releasing the lease allows another client to immediately acquire the lease for the file as soon as the release is complete.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.FileLeaseReleaseInfo>> ReleaseAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member ReleaseAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.FileLeaseReleaseInfo>>
override this.ReleaseAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.FileLeaseReleaseInfo>>
Public Overridable Function ReleaseAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of FileLeaseReleaseInfo))

Parameters

cancellationToken
CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

A Response<T> describing the updated file.

Remarks

A RequestFailedException will be thrown if a failure occurs.

Applies to