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:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
defaultEncryptionScopestringDefault the container to use specified encryption scope for all writes.
deletedbooleanIndicates whether the blob container was deleted.
deletedTimestring (date-time)Blob container deletion time.
denyEncryptionScopeOverridebooleanBlock override of encryption scope from the container default.
enableNfsV3AllSquashbooleanEnable NFSv3 all squash on blob container.
enableNfsV3RootSquashbooleanEnable NFSv3 root squash on blob container.
etagstringResource Etag.
hasImmutabilityPolicybooleanThe hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container.
hasLegalHoldbooleanThe hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account.
immutabilityPolicyobjectThe ImmutabilityPolicy property of the container.
immutableStorageWithVersioningobjectThe object level immutability property of the container. The property is immutable and can only be set to true at the container creation time. Existing containers must undergo a migration process.
lastModifiedTimestring (date-time)Returns the date and time the container was last modified.
leaseDurationstringSpecifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. Known values are: "Infinite" and "Fixed". (Infinite, Fixed)
leaseStatestringLease state of the container. Known values are: "Available", "Leased", "Expired", "Breaking", and "Broken". (Available, Leased, Expired, Breaking, Broken)
leaseStatusstringThe lease status of the container. Known values are: "Locked" and "Unlocked". (Locked, Unlocked)
legalHoldobjectThe LegalHold property of the container.
metadataobjectA name-value pair to associate with the container as metadata.
publicAccessstringSpecifies whether data in the container may be accessed publicly and the level of access. Known values are: "Container", "Blob", and "None". (Container, Blob, None)
remainingRetentionDaysintegerRemaining retention days for soft deleted blob container.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
versionstringThe version of the deleted blob container.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, account_name, container_name, subscription_idGets properties of a specified container.
listselectresource_group_name, account_name, subscription_id$maxpagesize, $filter, $includeLists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token.
createinsertresource_group_name, account_name, container_name, subscription_idCreates 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.
updateupdateresource_group_name, account_name, container_name, subscription_idUpdates 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.
deletedeleteresource_group_name, account_name, container_name, subscription_idDeletes specified container under its account.
get_immutability_policyexecresource_group_name, account_name, container_name, subscription_idGets the existing immutability policy along with the corresponding ETag in response headers and body.
create_or_update_immutability_policyexecresource_group_name, account_name, container_name, subscription_id, propertiesCreates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation.
delete_immutability_policyexecresource_group_name, account_name, container_name, subscription_idAborts 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.
set_legal_holdexecresource_group_name, account_name, container_name, subscription_id, 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_holdexecresource_group_name, account_name, container_name, subscription_id, 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.
leaseexecresource_group_name, account_name, container_name, subscription_id, 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_wormexecresource_group_name, account_name, container_name, subscription_idThis 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.
lock_immutability_policyexecresource_group_name, account_name, container_name, subscription_idSets 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_policyexecresource_group_name, account_name, container_name, subscription_id, 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.

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
account_namestringThe 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. Required.
container_namestringThe 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. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
$filterstringOptional. When specified, only container names starting with the filter will be listed. Default value is None.
$includestringOptional, used to include the properties for soft deleted blob containers. "deleted" Default value is None.
$maxpagesizestring

SELECT examples

Gets properties of a specified container.

SELECT
id,
name,
defaultEncryptionScope,
deleted,
deletedTime,
denyEncryptionScopeOverride,
enableNfsV3AllSquash,
enableNfsV3RootSquash,
etag,
hasImmutabilityPolicy,
hasLegalHold,
immutabilityPolicy,
immutableStorageWithVersioning,
lastModifiedTime,
leaseDuration,
leaseState,
leaseStatus,
legalHold,
metadata,
publicAccess,
remainingRetentionDays,
systemData,
type,
version
FROM azure.storage.blob_containers
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND account_name = '{{ account_name }}' -- required
AND container_name = '{{ container_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- 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 (
properties,
resource_group_name,
account_name,
container_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ account_name }}',
'{{ container_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
properties,
systemData,
type
;

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
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND account_name = '{{ account_name }}' --required
AND container_name = '{{ container_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
properties,
systemData,
type;

DELETE examples

Deletes specified container under its account.

DELETE FROM azure.storage.blob_containers
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND account_name = '{{ account_name }}' --required
AND container_name = '{{ container_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

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

EXEC azure.storage.blob_containers.get_immutability_policy 
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@container_name='{{ container_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;