Skip to main content

blob_containers_immutability_policies

Creates, updates, deletes, gets or lists a blob_containers_immutability_policies resource.

Overview

Nameblob_containers_immutability_policies
TypeResource
Idazure.storage.blob_containers_immutability_policies

Fields

The following fields are returned by SELECT queries:

OK -- Gets container ImmutabilityPolicy operation completed successfully.

NameDatatypeDescription
etagstringResource Etag.
propertiesobjectThe properties of an ImmutabilityPolicy of a blob container.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, accountName, containerName, immutabilityPolicyName, subscriptionIdIf-MatchGets the existing immutability policy along with the corresponding ETag in response headers and body.
create_or_updateinsertresourceGroupName, accountName, containerName, immutabilityPolicyName, subscriptionId, data__propertiesIf-MatchCreates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation.
deletedeleteresourceGroupName, accountName, containerName, immutabilityPolicyName, subscriptionId, If-MatchAborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
If-MatchstringThe 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.
accountNamestringThe name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
containerNamestringThe name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.
immutabilityPolicyNamestringThe name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default'
resourceGroupNamestringThe name of the resource group within the user's subscription. The name is case insensitive.
subscriptionIdstring (uuid)The ID of the target subscription. The value must be an UUID.
If-MatchstringThe 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.

SELECT examples

Gets the existing immutability policy along with the corresponding ETag in response headers and body.

SELECT
etag,
properties
FROM azure.storage.blob_containers_immutability_policies
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND accountName = '{{ accountName }}' -- required
AND containerName = '{{ containerName }}' -- required
AND immutabilityPolicyName = '{{ immutabilityPolicyName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND If-Match = '{{ If-Match }}'
;

INSERT examples

Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation.

INSERT INTO azure.storage.blob_containers_immutability_policies (
data__properties,
resourceGroupName,
accountName,
containerName,
immutabilityPolicyName,
subscriptionId,
If-Match
)
SELECT
'{{ properties }}' /* required */,
'{{ resourceGroupName }}',
'{{ accountName }}',
'{{ containerName }}',
'{{ immutabilityPolicyName }}',
'{{ subscriptionId }}',
'{{ If-Match }}'
RETURNING
etag,
properties
;

DELETE examples

Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container.

DELETE FROM azure.storage.blob_containers_immutability_policies
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND accountName = '{{ accountName }}' --required
AND containerName = '{{ containerName }}' --required
AND immutabilityPolicyName = '{{ immutabilityPolicyName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND If-Match = '{{ If-Match }}' --required
;