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
OK -- Get Container operation completed successfully.
Name | Datatype | Description |
---|---|---|
etag | string | Resource Etag. |
properties | object | Properties of the blob container. (x-ms-client-name: ContainerProperties) |
OK -- List Container operation completed successfully.
Name | Datatype | Description |
---|---|---|
etag | string | Resource Etag. |
properties | object | The blob container properties be listed out. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | resourceGroupName , accountName , containerName , subscriptionId | Gets properties of a specified container. | |
list | select | resourceGroupName , accountName , subscriptionId | $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 | resourceGroupName , accountName , containerName , subscriptionId | 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 | resourceGroupName , accountName , containerName , subscriptionId | 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 | resourceGroupName , accountName , containerName , subscriptionId | Deletes specified container under its account. | |
set_legal_hold | exec | resourceGroupName , accountName , containerName , subscriptionId , 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 | resourceGroupName , accountName , containerName , subscriptionId , 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. | |
lock_immutability_policy | exec | resourceGroupName , accountName , containerName , subscriptionId , If-Match | 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 | resourceGroupName , accountName , containerName , subscriptionId , If-Match , 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. | |
lease | exec | resourceGroupName , accountName , containerName , subscriptionId , 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 | resourceGroupName , accountName , containerName , subscriptionId | 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. |
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 |
---|---|---|
If-Match | 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. |
accountName | 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. |
containerName | 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. |
resourceGroupName | string | The name of the resource group within the user's subscription. The name is case insensitive. |
subscriptionId | string (uuid) | The ID of the target subscription. The value must be an UUID. |
$filter | string | Optional. When specified, only container names starting with the filter will be listed. |
$include | string | Optional, used to include the properties for soft deleted blob containers. |
$maxpagesize | string | Optional. Specified maximum number of containers that can be included in the list. |
SELECT
examples
- get
- list
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
;
Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token.
SELECT
etag,
properties
FROM azure.storage.blob_containers
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND accountName = '{{ accountName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- 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 (
data__properties,
resourceGroupName,
accountName,
containerName,
subscriptionId
)
SELECT
'{{ properties }}',
'{{ resourceGroupName }}',
'{{ accountName }}',
'{{ containerName }}',
'{{ subscriptionId }}'
RETURNING
etag,
properties
;
# Description fields are for documentation purposes
- name: blob_containers
props:
- name: resourceGroupName
value: string
description: Required parameter for the blob_containers resource.
- name: accountName
value: string
description: Required parameter for the blob_containers resource.
- name: containerName
value: string
description: Required parameter for the blob_containers resource.
- name: subscriptionId
value: string (uuid)
description: Required parameter for the blob_containers resource.
- name: properties
value: object
description: |
Properties of the blob container.
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
data__properties = '{{ properties }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND accountName = '{{ accountName }}' --required
AND containerName = '{{ containerName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
RETURNING
etag,
properties;
DELETE
examples
- delete
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
- set_legal_hold
- clear_legal_hold
- lock_immutability_policy
- extend_immutability_policy
- lease
- object_level_worm
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 }}
}'
;
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
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required,
@containerName='{{ containerName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"tags": "{{ tags }}",
"allowProtectedAppendWritesAll": {{ allowProtectedAppendWritesAll }}
}'
;
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
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required,
@containerName='{{ containerName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@If-Match='{{ If-Match }}' --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
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required,
@containerName='{{ containerName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@If-Match='{{ If-Match }}' --required
@@json=
'{
"properties": "{{ properties }}"
}'
;
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
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required,
@containerName='{{ containerName }}' --required,
@subscriptionId='{{ subscriptionId }}' --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
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required,
@containerName='{{ containerName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;