Condividi tramite


ImmutabilityPolicyResource.LockImmutabilityPolicyAsync Method

Definition

Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation.

  • Request Path. : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock.
  • Operation Id. : ImmutabilityPolicies_LockImmutabilityPolicy.
  • Default Api Version. : 2025-06-01.
  • Resource. : ImmutabilityPolicyResource.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Storage.ImmutabilityPolicyResource>> LockImmutabilityPolicyAsync(string ifMatch, System.Threading.CancellationToken cancellationToken = default);
abstract member LockImmutabilityPolicyAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Storage.ImmutabilityPolicyResource>>
override this.LockImmutabilityPolicyAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Storage.ImmutabilityPolicyResource>>
Public Overridable Function LockImmutabilityPolicyAsync (ifMatch As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of ImmutabilityPolicyResource))

Parameters

ifMatch
String

The entity state (ETag) version of the immutability policy to update must be returned to the server for all update operations. The ETag value must include the leading and trailing double quotes as returned by the service.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

ifMatch is null.

ifMatch is an empty string, and was expected to be non-empty.

Applies to