这里的类似于Pier-Luc Gendreau的答案,但与新的azure-cli v2.0相关。
az storage cors add --account-name $ACCNT_NAME --account-key $ACCNT_KEY \
--methods GET --origins '*' --services t --allowed-headers '*'
注意,V2.0是基于Python与之相对应的是基于Node.js的的v1.0
官方安装指令可here,但对我来说,下面似乎是一个更好的选择,以保持系统清洁:
virtualenv --system-site-packages -p python3 ~/azure-cli/
source ~/azure-cli/bin/activate
pip3 install azure-cli
下面是有关你可能想所需参数的帮助信息的提取物改变你的具体情况。
--methods [Required]: List of HTTP methods allowed to be executed by the origin. Allowed
values: DELETE, GET, HEAD, MERGE, OPTIONS, POST, PUT.
--origins [Required]: List of origin domains that will be allowed via CORS, or "*" to allow all
domains.
--services [Required]: The storage service(s) to add rules to. Allowed options are: (b)lob,
(f)ile, (q)ueue, (t)able. Can be combined.
您是否为您的blob存储配置了CORS规则? –
我该怎么做。我检查了天蓝色的文档,并没有发现它非常有用。谢谢 – vinayjags