LinuxCommandLibrary

az-storage-queue

Manage Azure Storage Queues

TLDR

Create a queue

$ az storage queue create --account-name [storage_account_name] [[-n|--name]] [queue_name] --metadata [queue_metadata]
copy

Generate a shared access signature for the queue
$ az storage queue generate-sas --account-name [storage_account_name] [[-n|--name]] [queue_name] --permissions [queue_permissions] --expiry [expiry_date] --https-only
copy

List queues in a storage account
$ az storage queue list --prefix [filter_prefix] --account-name [storage_account_name]
copy

Delete the specified queue and any messages it contains
$ az storage queue delete --account-name [storage_account_name] [[-n|--name]] [queue_name] --fail-not-exist
copy

SYNOPSIS

az storage queue create|delete|list|metadata|show|update [--account-key] [--account-name] [--connection-string] [--sas-token] [--timeout] [options]

PARAMETERS

--account-key
    Storage account access key(s).

--account-name
    Name of the storage account.

--connection-string
    Account connection string.

--sas-token
    Shared Access Signature (SAS) token.

--timeout
    Request timeout in seconds.

--debug
    Increase logging verbosity to debug level.

--help, -h
    Show this help message and exit.

--only-show-errors
    Suppress warnings; show errors only.

--output, -o
    Output format: json|jsonc|table|tsv|yaml.

--query
    JMESPath query string. See http://jmespath.org/.

--subscription
    Subscription name or ID.

--verbose
    Increase logging verbosity.

DESCRIPTION

az storage queue is a command group in the Azure CLI for managing queues in Azure Storage accounts. Storage queues provide a reliable, highly scalable way to decouple applications and handle asynchronous workloads by queuing messages for processing.

Supported operations include creating queues with unique names, deleting them, listing all queues in an account, retrieving queue properties or metadata, and updating properties like access tiers or metadata.

Commands require specifying a storage account using --account-name paired with --account-key, a --connection-string, or a --sas-token. Authentication supports Azure AD via az login, service principals, or keys. Output can be formatted as JSON, table, etc., for scripting. Timeouts and queries enhance usability for automation.

Ideal for DevOps, CI/CD pipelines, and cloud apps needing message queuing without infrastructure management.

CAVEATS

Requires Azure CLI 2.0+. Subcommands have additional options like --name (required for create/delete). Queue names must be 3-63 lowercase letters/numbers/hyphens. Needs storage account read/write permissions.

SUBCOMMANDS

create [--name]: Create queue.
delete [--name]: Delete queue.
list: List queues.
metadata show|update [--name]: Manage metadata.
show [--name]: Show properties.
update [--name]: Update properties.

HISTORY

Introduced in Azure CLI 2.0.0 (2018) as part of storage extensions. Enhanced in 2.10+ for Azure AD auth, SAS support, and metadata management. Ongoing updates align with Azure Storage APIs.

SEE ALSO

az storage account(1), az storage blob(1), az storage container(1), az storage message(1)

Copied to clipboard