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

Viewing Container Properties

Using the Azure Portal

The easiest way to view container properties is through the Azure portal:

  1. Navigate to your Storage Account in the Azure portal.
  2. In the left-hand menu, under "Data storage", select "Containers".
  3. Click on the name of the container you want to inspect.
  4. 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

  1. Navigate to the container in the Azure portal.
  2. Click on "Change access level" from the container's menu.
  3. 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.

Note: Container leases are typically managed programmatically or via specific Azure CLI/PowerShell commands for advanced scenarios.

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)
Important: Be cautious when changing public access levels, especially to 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.