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=2018-07-01

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

The ID of the target subscription.

resourceGroupName
path True
  • string

The name of the resource group within the user's subscription. The name is case insensitive.

Regex pattern: ^[-\w\._\(\)]+$

accountName
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.

containerName
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.

api-version
query True
  • string

The API version to use for this operation.

Request Body

Name Type Description
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
201 Created

Created -- Create Container operation completed successfully.

Examples

PutContainers

Sample Request

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/res3376/providers/Microsoft.Storage/storageAccounts/sto328/blobServices/default/containers/container6185?api-version=2018-07-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"
}

Definitions

BlobContainer

Properties of the blob container, including Id, resource name, resource type, Etag.

ImmutabilityPolicyProperties

The properties of an ImmutabilityPolicy of a blob container.

ImmutabilityPolicyState

The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked.

ImmutabilityPolicyUpdateType

The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend.

LeaseDuration

Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased.

LeaseState

Lease state of the container.

LeaseStatus

The lease status of the container.

LegalHoldProperties

The LegalHold property of a blob container.

PublicAccess

Specifies whether data in the container may be accessed publicly and the level of access.

TagProperty

A tag of the LegalHold of a blob container.

UpdateHistoryProperty

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.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.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.

type
  • string

The type of the resource. Ex- 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.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

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.

tags

The list of LegalHold tags of a blob container.

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
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.