You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AWS CLI上传命令的Azure CLI等效实现及aws-shell替代工具咨询

问题解答

1. 对应aws-shell的Azure工具

和AWS的aws-shell对应的是Azure CLI,并且Azure CLI提供了交互式模式,运行az interactive即可进入类似aws-shell的交互式环境,支持命令自动补全、实时语法提示、命令历史等功能,操作体验和aws-shell高度相似。

2. 递归上传本地jpg文件到Azure Blob存储的命令

对应你之前的AWS S3上传命令,使用Azure CLI的az storage blob upload-batch命令可以实现相同需求,具体命令如下:

# 首次使用或会话过期时先登录Azure CLI
az login

# 批量递归上传jpg文件到Azure Blob
az storage blob upload-batch \
  --source ./images/ \
  --destination <你的容器名称> \
  --destination-path images \
  --account-name <你的存储账户名称> \
  --pattern "*.jpg" \
  --content-type "image/jpeg" \
  --access-tier Hot \
  --public-access blob

参数说明(对应原AWS命令的参数):

  • --source:指定本地源文件夹,对应原命令的./images/
  • --destination:指定目标Blob容器名称,对应原命令的S3存储桶
  • --destination-path:指定容器内的目标路径前缀,对应原命令的s3://mybucket.com/images/中的images/路径
  • --pattern "*.jpg":实现只上传jpg文件,等同于原命令的--exclude "*" --include "*.jpg"
  • --content-type "image/jpeg":直接设置Blob的Content-Type,和原命令参数一致
  • --access-tier Hot:对应原命令的--storage-class STANDARD,指定使用Azure热存储层(适用于频繁访问的对象)
  • --public-access blob:对应原命令的--acl public-read,设置Blob允许匿名公共读取权限

注意:如果你的存储账户使用密钥认证,可添加--account-key <你的存储账户密钥>参数;若启用Azure AD身份验证则无需额外密钥。

内容的提问来源于stack exchange,提问作者Ommadawn

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.19 15:35:29