LinuxCommandLibrary

az-storage-blob

Manage Azure Blob Storage objects

TLDR

Upload a file to blob storage

$ az storage blob upload -f [/path/to/file] -c [container-name] -n [blob-name] --account-name [account]
copy
Download a blob to local filesystem
$ az storage blob download -f [/path/to/file] -c [container-name] -n [blob-name] --account-name [account]
copy
List blobs in a container
$ az storage blob list -c [container-name] --account-name [account] -o table
copy
Delete a blob
$ az storage blob delete -c [container-name] -n [blob-name] --account-name [account]
copy
Upload multiple files from a directory
$ az storage blob upload-batch -d [container-name] -s [/path/to/directory] --account-name [account]
copy
Download multiple blobs matching a pattern
$ az storage blob download-batch -d [./local-dir] -s [container-name] --pattern "*.txt" --account-name [account]
copy
Generate a SAS token for a blob
$ az storage blob generate-sas -c [container-name] -n [blob-name] --permissions [r] --expiry [2024-12-31T00:00Z] --account-name [account]
copy
Set blob access tier
$ az storage blob set-tier -c [container-name] -n [blob-name] --tier [Cool] --account-name [account]
copy

SYNOPSIS

az storage blob subcommand [options]

DESCRIPTION

az storage blob manages object storage for unstructured data in Azure Blob Storage. Blobs can store any type of text or binary data including documents, media files, and application data.
The command group supports uploading, downloading, copying, and managing blob properties, metadata, access tiers, and security settings.

PARAMETERS

-c, --container-name value

Name of the blob container
-n, --name value
Name of the blob
-f, --file value
Path to the local file for upload/download
--account-name value
Storage account name
--account-key value
Storage account key
--sas-token value
Shared Access Signature token
--tier value
Access tier: Hot, Cool, Cold, Archive
--pattern value
Glob pattern for batch operations

SUBCOMMANDS

Transfer Operations

upload, upload-batch, download, download-batch, copy start, copy cancel
Blob Management
list, delete, delete-batch, exists, show, snapshot, restore
Properties & Metadata
metadata show, metadata update, update, set-tier, tag list, tag set
Security
generate-sas, lease acquire, lease break, lease release, lease renew
Queries
query (SQL queries on blob data)

CAVEATS

Authentication is required via --account-key, --sas-token, --connection-string, or --auth-mode login. Archive tier blobs must be rehydrated before access. Batch operations respect patterns but do not recursively traverse virtual directories by default. Delete operations mark blobs for deletion; soft-delete policies may allow recovery.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community