Container Properties
This document describes how to view and manage properties for Azure Storage containers.
Understanding Container Properties
Each container in Azure Blob Storage has a set of properties that define its behavior and configuration. These properties can be managed through the Azure portal, Azure CLI, Azure PowerShell, or programmatically using the Azure Storage SDKs.
Key Container Properties
- Public Access Level: Controls whether blobs within the container can be accessed anonymously. Options include:
Off
: No anonymous access.Blob
: Anonymous access to individual blobs.Container
: Anonymous access to blobs and container metadata.
- Lease Status: Indicates if the container is leased. A lease provides a write lock on a container for a specified duration.
- Last Modified: Timestamp of the last modification to the container's metadata or properties.
- ETag: An entity tag (ETag) is a value that represents the version of the container.
- Access Tier: For blob containers, this property relates to the default access tier for new blobs. (Primarily managed at the storage account level or via lifecycle management).
- Immutable Storage: Properties related to retention policies and legal holds that prevent deletion or modification of blobs.
Viewing Container Properties
Using the Azure Portal
The easiest way to view container properties is through the Azure portal:
- Navigate to your Storage Account in the Azure portal.
- In the left-hand menu, under "Data storage", select "Containers".
- Click on the name of the container you want to inspect.
- On the container's overview page, you will see its properties, including public access level, lease status, and last modified date.
Using Azure CLI
You can retrieve container properties using the az storage container show
command:
az storage container show \
--name <container-name> \
--account-name <storage-account-name> \
--account-key <storage-account-key> \
--query "{Name:name, PublicAccess:publicAccess, LeaseStatus:leaseStatus, LastModified:lastModified, Etag:etag}" \
--output table
Replace <container-name>
, <storage-account-name>
, and <storage-account-key>
with your specific values. You can also use SAS tokens or managed identities for authentication.
Using Azure PowerShell
Use the Get-AzStorageContainer
cmdlet:
Get-AzStorageContainer -Name <container-name> -Context (Get-AzStorageAccount -ResourceGroupName <resource-group-name> -Name <storage-account-name>).Context
This command will display detailed information about the container.
Modifying Container Properties
Changing Public Access Level
You can modify the public access level for a container:
Azure Portal
- Navigate to the container in the Azure portal.
- Click on "Change access level" from the container's menu.
- Select the desired public access level and click "OK".
Azure CLI
az storage container set-permission \
--name <container-name> \
--account-name <storage-account-name> \
--public-access <blob|container|off> \
--account-key <storage-account-key>
Azure PowerShell
$container = Get-AzStorageContainer -Name <container-name> -Context (Get-AzStorageAccount -ResourceGroupName <resource-group-name> -Name <storage-account-name>).Context
$container.PublicAccess = <new-public-access-level> # e.g., 'Blob'
Set-AzStorageContainer -Container $container
Leasing a Container
Leasing is used for concurrency control. A lease provides an exclusive lock on a container. You can break, acquire, or renew a lease.
Container Properties Table Summary
Property | Description | Mutable |
---|---|---|
Name | The name of the container. | No |
Public Access Level | Controls anonymous access. | Yes |
Lease Status | Indicates if a lease is active. | Managed via lease operations (acquire, break, renew). |
Last Modified | Timestamp of last modification. | No (automatically updated) |
ETag | Version identifier. | No (automatically updated) |
Immutable Storage Properties | Retention and legal hold settings. | Yes (requires specific permissions) |
Container
or Blob
, as this can expose your data to the public internet if not secured properly.
For more advanced management and programmatic access, refer to the Azure Storage REST API documentation and the respective Azure SDKs.