I am trying to test download functionality for html5, angularjs application using azure storage emulator. For some reason, every time I send the file to azure the generated url for localhost, I keep getting CORS errors. Now in the cloud instance, I used the following code to add CORS support, and it works:
blobServiceProperties.Cors.CorsRules.Add(new CorsRule() { AllowedHeaders = new List<string>() { "*" }, //ExposedHeaders = new List<string>() {"*"}, AllowedMethods = CorsHttpMethods.Post | CorsHttpMethods.Put | CorsHttpMethods.Get | CorsHttpMethods.Delete, AllowedOrigins = new List<string>() { "http://example.com" }, MaxAgeInSeconds = 3600 });
When I try to run this for an emulator, I get errors indicating that this is not allowed. Should I configure CORS for the emulator, and if so, how can I do this since the code above does not work with the emulator?
source share