0

I enabled CORS in my Azure blob storage. But when I first enable the CORS, I set max-age as 86400. So After one day, I couldn't connect to Azure blob storage as it was expired.

How can I reset that CORS setting? And also can I set that CORS max-age as permanent?

Thank you in advance.

Branch
  • 88
  • 7
  • 2
    `I couldn't connect to Azure blob storage as it was expired` - This tells me that you are using a SAS URL to connect to blob storage. If that's the case, then you would need to regenerate a new SAS URL. CORS max-age setting is related to caching of CORS rules by user agent (browser, for example) and should not have any impact on accessing the blob. – Gaurav Mantri Apr 12 '23 at 17:18
  • Thank you. I think you are correct. I also just found the issue. – Branch Apr 12 '23 at 20:22

1 Answers1

0
  • Thanks to @Gaurav Mantri for leading into right direction and making it as a solution to help others also.
  • Yes i do agree with @ Gaurav Mantri that I couldn't connect to Azure blob storage as it was expired - This indicates that you are using a SAS URL to connect to blob storage. If that's the case, then you would need to regenerate a new SAS URL.
  • CORS max-age setting is related to caching of CORS rules by user agent (browser, for example) and should not have any impact on accessing the blob
  • From my end I created a blob storage and under settings added cores as shown in below image.

Here i am taking Blob service under this,

Allowed methods = GET,POST,PUT

Allowed headers = x-ms-blob-type,content-type

Exposed headers = x-ms-blob-type

Max age = 300 enter image description here The Max age value must not be empty. The value must be at least 0. The value must be at most 2147483647.

How can I reset that CORS setting? And also can I set that CORS max-age as permanent?

If you want to edit these core settings, you can simply select created one and you can edit all those allowed properties and max age.

  • Yes you can set to max age as permanent but please note that setting the max-age value to a very large number may not be the best security practice as it may expose your storage account to potential security risks.
vijaya
  • 1,525
  • 1
  • 2
  • 6