Forrest logo
back to the az tool

az-storage-container:tldr:1c234

az-storage-container: Create a container in a storage account.
$ az storage container create --account-name ${storage_account_name} --name ${container_name} --public-access ${access_level} --fail-on-exist
try on your machine

This command is used to create a container in an Azure Storage account using the Azure CLI (Command-Line Interface).

Here is the breakdown of the command and its parameters:

  • az storage container create: This is the main command used to create a container in Azure Storage.
  • --account-name ${storage_account_name}: This parameter specifies the name of the Azure Storage account where the container will be created. ${storage_account_name} is a placeholder for the actual name of the storage account that needs to be provided.
  • --name ${container_name}: This parameter defines the desired name for the container. ${container_name} is a placeholder for the actual name of the container that needs to be specified.
  • --public-access ${access_level}: This parameter specifies the level of public access to the container. ${access_level} is a placeholder for the desired public access level, which can be set to "container", "blob", or "off". "container" allows public read access to containers and their blobs, "blob" allows public read access to blobs only, and "off" restricts public access.
  • --fail-on-exist: This option is used to indicate that an error should occur if a container with the same name already exists.

Overall, this command creates a new container in an Azure Storage account with the specified name, public access level, and fails if a container with the same name already exists.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the az tool