← 返回命令列表

Linux command

az-storage-blob 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Upload a file

az storage blob upload -f [/path/to/file] -c [container-name] -n [blob-name] --account-name [account]

Download a blob

az storage blob download -f [/path/to/file] -c [container-name] -n [blob-name] --account-name [account]

List blobs

az storage blob list -c [container-name] --account-name [account] -o table

Delete a blob

az storage blob delete -c [container-name] -n [blob-name] --account-name [account]

Upload multiple files

az storage blob upload-batch -d [container-name] -s [/path/to/directory] --account-name [account]

Download multiple blobs

az storage blob download-batch -d [./local-dir] -s [container-name] --pattern "*.txt" --account-name [account]

Generate a SAS token

az storage blob generate-sas -c [container-name] -n [blob-name] --permissions [r] --expiry [2024-12-31T00:00Z] --account-name [account]

Set blob access tier

az storage blob set-tier -c [container-name] -n [blob-name] --tier [Cool] --account-name [account]

说明

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.

参数

-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
--overwrite
Overwrite existing blob on upload (default: false)
--auth-mode _value_
Authentication mode: login (Azure AD) or key
-o, --output _value_
Output format: json, table, tsv, yaml, jsonc, none

FAQ

What is the az-storage-blob command used for?

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.

How do I run a basic az-storage-blob example?

Run `az storage blob upload -f [/path/to/file] -c [container-name] -n [blob-name] --account-name [account]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -c, --container-name _value_ do in az-storage-blob?

Name of the blob container