BlobBaseClient.SetImmutabilityPolicyAsync Method

Definition

Sets the Immutability Policy on a Blob, Blob Snapshot, or Blob Version. Note that Blob Versioning must be enabled on your storage account, and the blob must be in a Container with immutable storage with versioning enabled to call this API.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobImmutabilityPolicy>> SetImmutabilityPolicyAsync (Azure.Storage.Blobs.Models.BlobImmutabilityPolicy immutabilityPolicy, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SetImmutabilityPolicyAsync : Azure.Storage.Blobs.Models.BlobImmutabilityPolicy * Azure.Storage.Blobs.Models.BlobRequestConditions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobImmutabilityPolicy>>
override this.SetImmutabilityPolicyAsync : Azure.Storage.Blobs.Models.BlobImmutabilityPolicy * Azure.Storage.Blobs.Models.BlobRequestConditions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobImmutabilityPolicy>>
Public Overridable Function SetImmutabilityPolicyAsync (immutabilityPolicy As BlobImmutabilityPolicy, Optional conditions As BlobRequestConditions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of BlobImmutabilityPolicy))

Parameters

immutabilityPolicy
BlobImmutabilityPolicy

The BlobImmutabilityPolicy to set.

conditions
BlobRequestConditions

Optional BlobRequestConditions to add conditions on setting the blob's HTTP headers. Note that If Unmodified Since is the only request condition applicable to this API.

cancellationToken
CancellationToken

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

Returns

A Response<T>.

Remarks

A RequestFailedException will be thrown if a failure occurs.

Applies to