Azure Storage Blob: set CORS on the blobs level?

2019-07-25 16:16发布

Currently, we have set CORS for the whole container with:

azure storage cors set --blob static --cors '[{"AllowedOrigins":"*","AllowedMethods":"GET","MaxAgeInSeconds":"86400"}]'

Is there any possibility to set rule directly and separately for each blob in that container?

E.g. - for static/images/pic.png set "AllowedOrigins":"*" but for static/css/style.css - set "AllowedOrigins":"google.com"?

1条回答
SAY GOODBYE
2楼-- · 2019-07-25 16:48

Is there any possibility to set rule directly and separately for each blob in that container?

Unfortunately no. The way I understand CORS is that it somehow enables trust between 2 domains. With Azure Storage, the domains are by service (e.g. youraccount.blob.core.windows.net etc.). Thus the CORS rules are set at the service level.

查看更多
登录 后发表回答