【问题标题】:Azure CLI storage set cors - Unexpected tokenAzure CLI 存储集 cors - 意外令牌
【发布时间】:2016-04-05 16:37:30
【问题描述】:

我正在尝试按照here 所述设置 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\"}] 有什么问题?

【问题讨论】:

    标签: azure cors azure-storage azure-cli


    【解决方案1】:

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

    azure storage cors set --blob static 
    --cors "[{\"AllowedOrigins\":\"*\",\"AllowedMethods\":\"GET\",\"MaxAgeInSeconds\":\"86400\",\"AllowedHeaders\":\"*\",\"ExposedHeaders\":\"*\"}]"
    -a "account-name" -k "account-key" --verbose
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-06
      • 2017-09-04
      • 2017-06-29
      • 1970-01-01
      • 1970-01-01
      • 2017-06-04
      • 2019-04-29
      • 1970-01-01
      相关资源
      最近更新 更多