Blob Containers - Create
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.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}?api-version=2023-01-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
account
|
path | True |
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. Regex pattern: |
container
|
path | True |
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. |
resource
|
path | True |
string |
The name of the resource group within the user's subscription. The name is case insensitive. Regex pattern: |
subscription
|
path | True |
string |
The ID of the target subscription. |
api-version
|
query | True |
string |
The API version to use for this operation. |
Request Body
Name | Type | Description |
---|---|---|
properties.defaultEncryptionScope |
string |
Default the container to use specified encryption scope for all writes. |
properties.denyEncryptionScopeOverride |
boolean |
Block override of encryption scope from the container default. |
properties.enableNfsV3AllSquash |
boolean |
Enable NFSv3 all squash on blob container. |
properties.enableNfsV3RootSquash |
boolean |
Enable NFSv3 root squash on blob container. |
properties.immutableStorageWithVersioning |
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. |
|
properties.metadata |
object |
A name-value pair to associate with the container as metadata. |
properties.publicAccess |
Specifies whether data in the container may be accessed publicly and the level of access. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK -- The Container is already created. |
|
201 Created |
Created -- Create Container operation completed successfully. |
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
Put |
Put |
Put |
PutContainers
Sample Request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/res3376/providers/Microsoft.Storage/storageAccounts/sto328/blobServices/default/containers/container6185?api-version=2023-01-01
{}
Sample Response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/res3376/providers/Microsoft.Storage/storageAccounts/sto328/blobServices/default/containers/container6185",
"name": "container6185",
"type": "Microsoft.Storage/storageAccounts/blobServices/containers"
}
{
"id": "/subscriptions/{subscription-id}/resourceGroups/res3376/providers/Microsoft.Storage/storageAccounts/sto328/blobServices/default/containers/container6185",
"name": "container6185",
"type": "Microsoft.Storage/storageAccounts/blobServices/containers"
}
PutContainerWithDefaultEncryptionScope
Sample Request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/res3376/providers/Microsoft.Storage/storageAccounts/sto328/blobServices/default/containers/container6185?api-version=2023-01-01
{
"properties": {
"defaultEncryptionScope": "encryptionscope185",
"denyEncryptionScopeOverride": true
}
}
Sample Response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/res3376/providers/Microsoft.Storage/storageAccounts/sto328/blobServices/default/containers/container6185",
"name": "container6185",
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
"properties": {
"defaultEncryptionScope": "encryptionscope185",
"denyEncryptionScopeOverride": true
}
}
{
"id": "/subscriptions/{subscription-id}/resourceGroups/res3376/providers/Microsoft.Storage/storageAccounts/sto328/blobServices/default/containers/container6185",
"name": "container6185",
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
"properties": {
"defaultEncryptionScope": "encryptionscope185",
"denyEncryptionScopeOverride": true
}
}
PutContainerWithObjectLevelWorm
Sample Request
PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/res3376/providers/Microsoft.Storage/storageAccounts/sto328/blobServices/default/containers/container6185?api-version=2023-01-01
{
"properties": {
"immutableStorageWithVersioning": {
"enabled": true
}
}
}
Sample Response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/res3376/providers/Microsoft.Storage/storageAccounts/sto328/blobServices/default/containers/container6185",
"name": "container6185",
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
"properties": {
"immutableStorageWithVersioning": {
"enabled": true
}
}
}
{
"id": "/subscriptions/{subscription-id}/resourceGroups/res3376/providers/Microsoft.Storage/storageAccounts/sto328/blobServices/default/containers/container6185",
"name": "container6185",
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
"properties": {
"immutableStorageWithVersioning": {
"enabled": true
}
}
}
Definitions
Name | Description |
---|---|
Blob |
Properties of the blob container, including Id, resource name, resource type, Etag. |
Immutability |
The properties of an ImmutabilityPolicy of a blob container. |
Immutability |
The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. |
Immutability |
The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. |
Immutable |
Object level immutability properties of the container. |
Lease |
Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. |
Lease |
Lease state of the container. |
Lease |
The lease status of the container. |
Legal |
The LegalHold property of a blob container. |
Migration |
This property denotes the container level immutability to object level immutability migration state. |
Protected |
Protected append writes history setting for the blob container with Legal holds. |
Public |
Specifies whether data in the container may be accessed publicly and the level of access. |
Tag |
A tag of the LegalHold of a blob container. |
Update |
An update history of the ImmutabilityPolicy of a blob container. |
BlobContainer
Properties of the blob container, including Id, resource name, resource type, Etag.
Name | Type | Description |
---|---|---|
etag |
string |
Resource Etag. |
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 |
properties.defaultEncryptionScope |
string |
Default the container to use specified encryption scope for all writes. |
properties.deleted |
boolean |
Indicates whether the blob container was deleted. |
properties.deletedTime |
string |
Blob container deletion time. |
properties.denyEncryptionScopeOverride |
boolean |
Block override of encryption scope from the container default. |
properties.enableNfsV3AllSquash |
boolean |
Enable NFSv3 all squash on blob container. |
properties.enableNfsV3RootSquash |
boolean |
Enable NFSv3 root squash on blob container. |
properties.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. |
properties.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. |
properties.immutabilityPolicy |
The ImmutabilityPolicy property of the container. |
|
properties.immutableStorageWithVersioning |
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. |
|
properties.lastModifiedTime |
string |
Returns the date and time the container was last modified. |
properties.leaseDuration |
Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. |
|
properties.leaseState |
Lease state of the container. |
|
properties.leaseStatus |
The lease status of the container. |
|
properties.legalHold |
The LegalHold property of the container. |
|
properties.metadata |
object |
A name-value pair to associate with the container as metadata. |
properties.publicAccess |
Specifies whether data in the container may be accessed publicly and the level of access. |
|
properties.remainingRetentionDays |
integer |
Remaining retention days for soft deleted blob container. |
properties.version |
string |
The version of the deleted blob container. |
type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
ImmutabilityPolicyProperties
The properties of an ImmutabilityPolicy of a blob container.
Name | Type | Description |
---|---|---|
etag |
string |
ImmutabilityPolicy Etag. |
properties.allowProtectedAppendWrites |
boolean |
This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. |
properties.allowProtectedAppendWritesAll |
boolean |
This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. |
properties.immutabilityPeriodSinceCreationInDays |
integer |
The immutability period for the blobs in the container since the policy creation, in days. |
properties.state |
The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. |
|
updateHistory |
The ImmutabilityPolicy update history of the blob container. |
ImmutabilityPolicyState
The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked.
Name | Type | Description |
---|---|---|
Locked |
string |
|
Unlocked |
string |
ImmutabilityPolicyUpdateType
The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend.
Name | Type | Description |
---|---|---|
extend |
string |
|
lock |
string |
|
put |
string |
ImmutableStorageWithVersioning
Object level immutability properties of the container.
Name | Type | Description |
---|---|---|
enabled |
boolean |
This is an immutable property, when set to true it enables object level immutability at the container level. |
migrationState |
This property denotes the container level immutability to object level immutability migration state. |
|
timeStamp |
string |
Returns the date and time the object level immutability was enabled. |
LeaseDuration
Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased.
Name | Type | Description |
---|---|---|
Fixed |
string |
|
Infinite |
string |
LeaseState
Lease state of the container.
Name | Type | Description |
---|---|---|
Available |
string |
|
Breaking |
string |
|
Broken |
string |
|
Expired |
string |
|
Leased |
string |
LeaseStatus
The lease status of the container.
Name | Type | Description |
---|---|---|
Locked |
string |
|
Unlocked |
string |
LegalHoldProperties
The LegalHold property of a blob container.
Name | Type | Description |
---|---|---|
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. |
protectedAppendWritesHistory |
Protected append blob writes history. |
|
tags |
The list of LegalHold tags of a blob container. |
MigrationState
This property denotes the container level immutability to object level immutability migration state.
Name | Type | Description |
---|---|---|
Completed |
string |
|
InProgress |
string |
ProtectedAppendWritesHistory
Protected append writes history setting for the blob container with Legal holds.
Name | Type | Description |
---|---|---|
allowProtectedAppendWritesAll |
boolean |
When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. |
timestamp |
string |
Returns the date and time the tag was added. |
PublicAccess
Specifies whether data in the container may be accessed publicly and the level of access.
Name | Type | Description |
---|---|---|
Blob |
string |
|
Container |
string |
|
None |
string |
TagProperty
A tag of the LegalHold of a blob container.
Name | Type | Description |
---|---|---|
objectIdentifier |
string |
Returns the Object ID of the user who added the tag. |
tag |
string |
The tag value. |
tenantId |
string |
Returns the Tenant ID that issued the token for the user who added the tag. |
timestamp |
string |
Returns the date and time the tag was added. |
upn |
string |
Returns the User Principal Name of the user who added the tag. |
UpdateHistoryProperty
An update history of the ImmutabilityPolicy of a blob container.
Name | Type | Description |
---|---|---|
allowProtectedAppendWrites |
boolean |
This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. |
allowProtectedAppendWritesAll |
boolean |
This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. |
immutabilityPeriodSinceCreationInDays |
integer |
The immutability period for the blobs in the container since the policy creation, in days. |
objectIdentifier |
string |
Returns the Object ID of the user who updated the ImmutabilityPolicy. |
tenantId |
string |
Returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy. |
timestamp |
string |
Returns the date and time the ImmutabilityPolicy was updated. |
update |
The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. |
|
upn |
string |
Returns the User Principal Name of the user who updated the ImmutabilityPolicy. |