blob_containers
Creates, updates, deletes, gets or lists a blob_containers resource.
Overview
| Name | blob_containers |
| Type | Resource |
| Id | azure.storage.blob_containers |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
defaultEncryptionScope | string | Default the container to use specified encryption scope for all writes. |
deleted | boolean | Indicates whether the blob container was deleted. |
deletedTime | string (date-time) | Blob container deletion time. |
denyEncryptionScopeOverride | boolean | Block override of encryption scope from the container default. |
enableNfsV3AllSquash | boolean | Enable NFSv3 all squash on blob container. |
enableNfsV3RootSquash | boolean | Enable NFSv3 root squash on blob container. |
etag | string | Resource Etag. |
hasImmutabilityPolicy | boolean | The 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. |
hasLegalHold | boolean | The 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. |
immutabilityPolicy | object | The ImmutabilityPolicy property of the container. |
immutableStorageWithVersioning | object | The 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. |
lastModifiedTime | string (date-time) | Returns the date and time the container was last modified. |
leaseDuration | string | Specifies 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) |
leaseState | string | Lease state of the container. Known values are: "Available", "Leased", "Expired", "Breaking", and "Broken". (Available, Leased, Expired, Breaking, Broken) |
leaseStatus | string | The lease status of the container. Known values are: "Locked" and "Unlocked". (Locked, Unlocked) |
legalHold | object | The LegalHold property of the container. |
metadata | object | A name-value pair to associate with the container as metadata. |
publicAccess | string | Specifies whether data in the container may be accessed publicly and the level of access. Known values are: "Container", "Blob", and "None". (Container, Blob, None) |
remainingRetentionDays | integer | Remaining retention days for soft deleted blob container. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
version | string | The version of the deleted blob container. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
defaultEncryptionScope | string | Default the container to use specified encryption scope for all writes. |
deleted | boolean | Indicates whether the blob container was deleted. |
deletedTime | string (date-time) | Blob container deletion time. |
denyEncryptionScopeOverride | boolean | Block override of encryption scope from the container default. |
enableNfsV3AllSquash | boolean | Enable NFSv3 all squash on blob container. |
enableNfsV3RootSquash | boolean | Enable NFSv3 root squash on blob container. |
etag | string | Resource Etag. |
hasImmutabilityPolicy | boolean | The 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. |
hasLegalHold | boolean | The 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. |
immutabilityPolicy | object | The ImmutabilityPolicy property of the container. |
immutableStorageWithVersioning | object | The 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. |
lastModifiedTime | string (date-time) | Returns the date and time the container was last modified. |
leaseDuration | string | Specifies 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) |
leaseState | string | Lease state of the container. Known values are: "Available", "Leased", "Expired", "Breaking", and "Broken". (Available, Leased, Expired, Breaking, Broken) |
leaseStatus | string | The lease status of the container. Known values are: "Locked" and "Unlocked". (Locked, Unlocked) |
legalHold | object | The LegalHold property of the container. |
metadata | object | A name-value pair to associate with the container as metadata. |
publicAccess | string | Specifies whether data in the container may be accessed publicly and the level of access. Known values are: "Container", "Blob", and "None". (Container, Blob, None) |
remainingRetentionDays | integer | Remaining retention days for soft deleted blob container. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
version | string | The version of the deleted blob container. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, account_name, container_name, subscription_id | Gets properties of a specified container. | |
list | select | resource_group_name, account_name, subscription_id | $maxpagesize, $filter, $include | Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. |
create | insert | resource_group_name, account_name, container_name, subscription_id | 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. | |
update | update | resource_group_name, account_name, container_name, subscription_id | 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. | |
delete | delete | resource_group_name, account_name, container_name, subscription_id | Deletes specified container under its account. | |
get_immutability_policy | exec | resource_group_name, account_name, container_name, subscription_id | Gets the existing immutability policy along with the corresponding ETag in response headers and body. | |
create_or_update_immutability_policy | exec | resource_group_name, account_name, container_name, subscription_id, properties | Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. | |
delete_immutability_policy | exec | resource_group_name, account_name, container_name, subscription_id | 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. | |
set_legal_hold | exec | resource_group_name, account_name, container_name, subscription_id, tags | 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. | |
clear_legal_hold | exec | resource_group_name, account_name, container_name, subscription_id, tags | Clears 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. | |
lease | exec | resource_group_name, account_name, container_name, subscription_id, action | The 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_worm | exec | resource_group_name, account_name, container_name, subscription_id | This 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_policy | exec | resource_group_name, account_name, container_name, subscription_id | 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. | |
extend_immutability_policy | exec | resource_group_name, account_name, container_name, subscription_id, properties | Extends 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.
| Name | Datatype | Description |
|---|---|---|
account_name | string | The 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_name | string | The 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_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string | |
$filter | string | Optional. When specified, only container names starting with the filter will be listed. Default value is None. |
$include | string | Optional, used to include the properties for soft deleted blob containers. "deleted" Default value is None. |
$maxpagesize | string |
SELECT examples
- get
- list
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
;
Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token.
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 subscription_id = '{{ subscription_id }}' -- required
AND $maxpagesize = '{{ $maxpagesize }}'
AND $filter = '{{ $filter }}'
AND $include = '{{ $include }}'
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: blob_containers
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the blob_containers resource.
- name: account_name
value: "{{ account_name }}"
description: Required parameter for the blob_containers resource.
- name: container_name
value: "{{ container_name }}"
description: Required parameter for the blob_containers resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the blob_containers resource.
- name: properties
description: |
Properties of the blob container.
value:
version: "{{ version }}"
deleted: {{ deleted }}
deletedTime: "{{ deletedTime }}"
remainingRetentionDays: {{ remainingRetentionDays }}
defaultEncryptionScope: "{{ defaultEncryptionScope }}"
denyEncryptionScopeOverride: {{ denyEncryptionScopeOverride }}
publicAccess: "{{ publicAccess }}"
lastModifiedTime: "{{ lastModifiedTime }}"
leaseStatus: "{{ leaseStatus }}"
leaseState: "{{ leaseState }}"
leaseDuration: "{{ leaseDuration }}"
metadata: "{{ metadata }}"
immutabilityPolicy:
properties:
immutabilityPeriodSinceCreationInDays: {{ immutabilityPeriodSinceCreationInDays }}
state: "{{ state }}"
allowProtectedAppendWrites: {{ allowProtectedAppendWrites }}
allowProtectedAppendWritesAll: {{ allowProtectedAppendWritesAll }}
etag: "{{ etag }}"
updateHistory:
- update: "{{ update }}"
immutabilityPeriodSinceCreationInDays: {{ immutabilityPeriodSinceCreationInDays }}
timestamp: "{{ timestamp }}"
objectIdentifier: "{{ objectIdentifier }}"
tenantId: "{{ tenantId }}"
upn: "{{ upn }}"
allowProtectedAppendWrites: {{ allowProtectedAppendWrites }}
allowProtectedAppendWritesAll: {{ allowProtectedAppendWritesAll }}
legalHold:
hasLegalHold: {{ hasLegalHold }}
tags:
- tag: "{{ tag }}"
timestamp: "{{ timestamp }}"
objectIdentifier: "{{ objectIdentifier }}"
tenantId: "{{ tenantId }}"
upn: "{{ upn }}"
protectedAppendWritesHistory:
allowProtectedAppendWritesAll: {{ allowProtectedAppendWritesAll }}
timestamp: "{{ timestamp }}"
hasLegalHold: {{ hasLegalHold }}
hasImmutabilityPolicy: {{ hasImmutabilityPolicy }}
immutableStorageWithVersioning:
enabled: {{ enabled }}
timeStamp: "{{ timeStamp }}"
migrationState: "{{ migrationState }}"
enableNfsV3RootSquash: {{ enableNfsV3RootSquash }}
enableNfsV3AllSquash: {{ enableNfsV3AllSquash }}
UPDATE examples
- update
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
- delete
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
- get_immutability_policy
- create_or_update_immutability_policy
- delete_immutability_policy
- set_legal_hold
- clear_legal_hold
- lease
- object_level_worm
- lock_immutability_policy
- extend_immutability_policy
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
;
Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation.
EXEC azure.storage.blob_containers.create_or_update_immutability_policy
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@container_name='{{ container_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"properties": "{{ properties }}"
}'
;
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.
EXEC azure.storage.blob_containers.delete_immutability_policy
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@container_name='{{ container_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
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
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@container_name='{{ container_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"tags": "{{ tags }}",
"allowProtectedAppendWritesAll": {{ allowProtectedAppendWritesAll }}
}'
;
Clears 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.
EXEC azure.storage.blob_containers.clear_legal_hold
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@container_name='{{ container_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"tags": "{{ tags }}",
"allowProtectedAppendWritesAll": {{ allowProtectedAppendWritesAll }}
}'
;
The 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.
EXEC azure.storage.blob_containers.lease
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@container_name='{{ container_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"action": "{{ action }}",
"leaseId": "{{ leaseId }}",
"breakPeriod": {{ breakPeriod }},
"leaseDuration": {{ leaseDuration }},
"proposedLeaseId": "{{ proposedLeaseId }}"
}'
;
This 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.
EXEC azure.storage.blob_containers.object_level_worm
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@container_name='{{ container_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
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.
EXEC azure.storage.blob_containers.lock_immutability_policy
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@container_name='{{ container_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Extends 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.
EXEC azure.storage.blob_containers.extend_immutability_policy
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@container_name='{{ container_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"properties": "{{ properties }}"
}'
;