问题
I'm trying set CORS as mentioned here but have an error:
$ 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 :
What's wrong with [{\"AllowedOrigins\":\"*\",\"AllowedMethods\":\"GET\"}]
?
回答1:
I believe you're missing MaxAgeInSeconds
parameter. If I try without this parameter, I get an error. However the following worked for me:
azure storage cors set --blob static
--cors "[{\"AllowedOrigins\":\"*\",\"AllowedMethods\":\"GET\",\"MaxAgeInSeconds\":\"86400\",\"AllowedHeaders\":\"*\",\"ExposedHeaders\":\"*\"}]"
-a "account-name" -k "account-key" --verbose
来源:https://stackoverflow.com/questions/36432222/azure-cli-storage-set-cors-unexpected-token