Skip to content

Instantly share code, notes, and snippets.

@GuyHarwood
Forked from stuartleeks/SetStorageCorsOptions
Last active February 22, 2017 16:03
Show Gist options
  • Save GuyHarwood/0db4dd4c3b10bf9c632d618859de2292 to your computer and use it in GitHub Desktop.
Save GuyHarwood/0db4dd4c3b10bf9c632d618859de2292 to your computer and use it in GitHub Desktop.
Command to set CORS policy for a storage account using Azure xplat CLI.
azure storage cors set -a <storageAccount> -k <accountKey> --blob --cors '[{"AllowedMethods":["GET","OPTIONS"],"AllowedOrigins":["*"],"AllowedHeaders":["Accept","Accept-Encoding","Accept-Language","Access-Control-Request-Headers","Access-Control-Request-Method","Cache-Control","Connection","Content-Type","DNT","Host","Origin","Pragma","Referer","User-Agent","x-ms-blob-content-type","x-ms-blob-type"],"ExposedHeaders":[],"MaxAgeInSeconds":60}]'
@GuyHarwood
Copy link
Author

The example allows GET and OPTIONS on any domain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment