Forrest logo
back to the az tool

az-storage-container:tldr:9664b

az-storage-container: Generate a shared access signature for the container.
$ az storage container generate-sas --account-name ${storage_account_name} --name ${container_name} --permissions ${sas_permissions} --expiry ${expiry_date} --https-only
try on your machine

The command is using the Azure CLI (Command Line Interface) to generate a Shared Access Signature (SAS) for a storage container in Azure Storage.

Explanation of the command options:

  • az storage container generate-sas: This specifies the command to generate a SAS token for an Azure Storage container.
  • --account-name ${storage_account_name}: This specifies the name of the storage account where the container exists. The ${storage_account_name} placeholder needs to be replaced with the actual name of the storage account.
  • --name ${container_name}: This specifies the name of the container for which the SAS token is being generated. The ${container_name} placeholder needs to be replaced with the actual name of the container.
  • --permissions ${sas_permissions}: This specifies the permissions granted by the SAS token to access the container. The ${sas_permissions} placeholder needs to be replaced with the desired permissions. For example, "rwdl" means read, write, delete, and list.
  • --expiry ${expiry_date}: This specifies the expiry date of the SAS token. The ${expiry_date} placeholder needs to be replaced with the desired expiry date and time. It is recommended to use ISO 8601 format.
  • --https-only: This ensures that the SAS token enforces HTTPS-only access to the container. It indicates that the SAS token can only be used with HTTPS URLs.

By executing this command with the appropriate values for the placeholders, a SAS token will be generated, which can be used to grant temporary and limited access to the specified storage container.

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