← 返回命令列表

Linux command

az-storage 命令

网络

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

常用示例

Copy a local file

az storage copy -s [/path/to/file.txt] -d https://[account].blob.core.windows.net/[container]/[blob]

Download a blob

az storage copy -s https://[account].blob.core.windows.net/[container]/[blob] -d [/path/to/file.txt]

Upload a directory recursively

az storage copy -s [/path/to/dir] -d https://[account].blob.core.windows.net/[container]/[path/] --recursive

Copy between storage accounts

az storage copy -s https://[src].blob.core.windows.net/[container]/[blob] -d https://[dest].blob.core.windows.net/[container]/[blob]

Delete a blob

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

Delete a directory

az storage remove -c [container-name] -n [path/to/directory] --recursive --account-name [account]

Copy from AWS S3

az storage copy -s https://s3.amazonaws.com/[bucket]/[object] -d https://[account].blob.core.windows.net/[container]/[blob]

说明

az storage manages Azure Cloud Storage resources including storage accounts, blob containers, file shares, queues, and tables. It provides commands for uploading, downloading, copying, and managing stored data. Azure Storage offers multiple storage types: Blob storage for unstructured data, File storage for SMB file shares, Queue storage for messaging, and Table storage for NoSQL data.

参数

--account-name _value_
Storage account name
--account-key _value_
Storage account access key
--connection-string _value_
Storage account connection string
-c, --container _value_
Blob container name
-s, --source _value_
Source path (local or URL)
-d, --destination _value_
Destination path (local or URL)
--recursive
Process subdirectories recursively.
--auth-mode _value_
Authentication mode: key (uses account key) or login (uses Azure AD credentials).
--sas-token _value_
Shared access signature token used to authenticate the request.

FAQ

What is the az-storage command used for?

az storage manages Azure Cloud Storage resources including storage accounts, blob containers, file shares, queues, and tables. It provides commands for uploading, downloading, copying, and managing stored data. Azure Storage offers multiple storage types: Blob storage for unstructured data, File storage for SMB file shares, Queue storage for messaging, and Table storage for NoSQL data.

How do I run a basic az-storage example?

Run `az storage copy -s [/path/to/file.txt] -d https://[account].blob.core.windows.net/[container]/[blob]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --account-name _value_ do in az-storage?

Storage account name