Azure 存储 Blob : set CORS on the blobs level?

标签 azure cors azure-blob-storage

目前,我们已经为整个容器设置了 CORS:

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

是否有可能直接为该容器中的每个blob设置规则?

例如- 对于 static/images/pic.png 设置 "AllowedOrigins":"*" 但对于 static/css/style.css - 设置 “AllowedOrigins”:“google.com”

最佳答案

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

不幸的是没有。我理解 CORS 的方式是它以某种方式实现了两个域之间的信任。对于 Azure 存储,域是按服务划分的(例如 youraccount.blob.core.windows.net 等)。因此,CORS 规则是在服务级别设置的。

关于Azure 存储 Blob : set CORS on the blobs level?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36543488/

相关文章:

asp.net-mvc - 是否可以在 Azure 上部署 WebRole,并使用 Cloud Numerics 进行计算?

Azure Bicep - 引用无法在开始时计算的变量

http - 使用 Chrome/WebKit 调试 Access-Control-Allow-Origin

azure - 为什么Azure文件/blob存储使用表请求

c# - 远程服务器返回错误 : (412) The condition specified using HTTP conditional header(s) is not met. 。

azure - CosmosDB 在某些情况下不使用索引

Azure:辅助角色写入 c:\或本地存储

c# - 在 ASP.NET 中,如何只为 TTF 文件添加 CORS header ?

javascript - PouchDB 身份验证触发 CORS 预检请求

c# - 如何递归加载Azure blob文件列表?