我正在尝试按上述设置 CORS here但有一个错误:
$ azure storage cors set --blob static --cors [{\"AllowedOrigins\":\"*\",\"AllowedMethods\":\"GET\"}]
info: Executing command storage cors set
+ Setting storage CORS rules for service: blob
error: Unexpected token :
[{\"AllowedOrigins\":\"*\",\"AllowedMethods\":\"GET\"}]
有什么问题吗?
最佳答案
我相信您缺少 MaxAgeInSeconds
参数。如果我尝试不使用此参数,则会收到错误。然而,以下内容对我有用:
azure storage cors set --blob static
--cors "[{\"AllowedOrigins\":\"*\",\"AllowedMethods\":\"GET\",\"MaxAgeInSeconds\":\"86400\",\"AllowedHeaders\":\"*\",\"ExposedHeaders\":\"*\"}]"
-a "account-name" -k "account-key" --verbose
关于Azure CLI 存储集 cors - 意外 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36432222/