Skip to main content

blob_containers

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

Overview

Nameblob_containers
TypeResource
Idazure.storage.blob_containers

Fields

The following fields are returned by SELECT queries:

OK -- Get Container operation completed successfully.

NameDatatypeDescription
etagstringResource Etag.
propertiesobjectProperties of the blob container. (x-ms-client-name: ContainerProperties)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, accountName, containerName, subscriptionIdGets properties of a specified container.
listselectresourceGroupName, accountName, subscriptionId$maxpagesize, $filter, $includeLists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token.
createinsertresourceGroupName, accountName, containerName, subscriptionIdCreates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container.
updateupdateresourceGroupName, accountName, containerName, subscriptionIdUpdates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist.
deletedeleteresourceGroupName, accountName, containerName, subscriptionIdDeletes specified container under its account.
set_legal_holdexecresourceGroupName, accountName, containerName, subscriptionId, tagsSets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request.
clear_legal_holdexecresourceGroupName, accountName, containerName, subscriptionId, tagsClears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request.
lock_immutability_policyexecresourceGroupName, accountName, containerName, subscriptionId, If-MatchSets 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.
extend_immutability_policyexecresourceGroupName, accountName, containerName, subscriptionId, If-Match, propertiesExtends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation.
leaseexecresourceGroupName, accountName, containerName, subscriptionId, actionThe Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite.
object_level_wormexecresourceGroupName, accountName, containerName, subscriptionIdThis operation migrates a blob container from container level WORM to object level immutability enabled container. Prerequisites require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled and there should be no Legal hold on the 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.
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.
$filterstringOptional. When specified, only container names starting with the filter will be listed.
$includestringOptional, used to include the properties for soft deleted blob containers.
$maxpagesizestringOptional. Specified maximum number of containers that can be included in the list.

SELECT examples

Gets properties of a specified container.

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

INSERT examples

Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container.

INSERT INTO azure.storage.blob_containers (
data__properties,
resourceGroupName,
accountName,
containerName,
subscriptionId
)
SELECT
'{{ properties }}',
'{{ resourceGroupName }}',
'{{ accountName }}',
'{{ containerName }}',
'{{ subscriptionId }}'
RETURNING
etag,
properties
;

UPDATE examples

Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist.

UPDATE azure.storage.blob_containers
SET
data__properties = '{{ properties }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND accountName = '{{ accountName }}' --required
AND containerName = '{{ containerName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
RETURNING
etag,
properties;

DELETE examples

Deletes specified container under its account.

DELETE FROM azure.storage.blob_containers
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND accountName = '{{ accountName }}' --required
AND containerName = '{{ containerName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;

Lifecycle Methods

Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request.

EXEC azure.storage.blob_containers.set_legal_hold 
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required,
@containerName='{{ containerName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"tags": "{{ tags }}",
"allowProtectedAppendWritesAll": {{ allowProtectedAppendWritesAll }}
}'
;