2016-04-05 3 views
2

hereを述べたが、エラーが発生しているように私は設定CORSをしようとしている:AzureのCLIストレージセット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\"}]が悪いのか?

答えて

3

MaxAgeInSecondsパラメータが不足していると思います。このパラメータを指定しないと試してみるとエラーになります。しかし、私のために働いた:

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