Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

CORs has no effect in Azure Storage

I tried adding this policy in Resource sharing (CORS) in my blob storage via Azure Portal, but it has no effect. I am still able to access the blob file in any browser. How do I correctly set it up? Must only work for localhost:3000 origin. Allowed methods: GET, OPTION only.

enter image description here

Does Networking have to do with the issue?
enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You are misunderstanding the purpose of CORS rules. CORS rule will prevent the access to blob when the blob is accessed via JavaScript using AJAX calls. It will not prevent the access to a blob when it is accessed via its URL in a browser. From this link:

CORS is an HTTP feature that enables a web application running under
one domain to access resources in another domain
. Web browsers
implement a security restriction known as same-origin policy that
prevents a web page from calling APIs in a different domain; CORS
provides a secure way to allow one domain (the origin domain) to call
APIs in another domain. See the CORS specification for details on
CORS.

To allow access from certain IP addresses, you will either need to set Firewall rules or use a Shared Access Signature with IP address restrictions.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading