I have an Azure Storage Account (classic) and I enabled CORS through the portal in this way:
Now I have a Flutter Web App (PWA) that needs to get some images from this storage, but it gets CORS errors.
I also tried with a test web page with a simple jquery ajax call and I gets the same errors. This is the jquery code:
$.ajax({
url: 'https://xxxx.blob.core.windows.net/test.jpg',
type: 'get',
success: function(data, status) {
console.log("Status: "+status+"\nData: "+data);
},
error: function (result) {
console.log(result);
}
});
The error message is:
Access to XMLHttpRequest at 'https://xxxx.blob.core.windows.net/test.jpg' from origin 'https://zzz.azurewebsites.net' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
How can I add the Response Header: access-control-allow-origin: *
Thanks.