2

我正在尝试按照此处所述设置 CORS,但出现错误:

$ 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\"}]

4

1 回答 1

3

我相信你缺少MaxAgeInSeconds参数。如果我尝试不使用此参数,则会收到错误消息。但是,以下内容对我有用:

azure storage cors set --blob static 
--cors "[{\"AllowedOrigins\":\"*\",\"AllowedMethods\":\"GET\",\"MaxAgeInSeconds\":\"86400\",\"AllowedHeaders\":\"*\",\"ExposedHeaders\":\"*\"}]"
-a "account-name" -k "account-key" --verbose
于 2016-04-05T18:03:15.143 回答