简体   繁体   English

Azure Blob存储-Blob策略

[英]Azure blob storage - blob policy

I am doing web application with profile photo uploader. 我正在使用个人资料照片上传程序做Web应用程序。 All photos are stored in one container with UUID as name. 所有照片均以UUID作为名称存储在一个容器中。 Idea is to send back to client side photos according to requested id ( REST API is used in this app). 想法是根据请求的ID发回客户端照片(此应用程序使用REST API)。

Question : 题 :

What is the best aproach while working with Azure storage to expose those images to client . 使用Azure存储将那些映像公开给客户端时,最好的方法是什么。

My ideas : 我的想法:

  1. Create REST service -> read blob from stream and return it to client side with proper content-type . 创建REST服务->从流中读取blob并将其以适当的content-type返回给客户端。 ( efficiency problem - new stram must be created) (效率问题-必须创建新的策略)
  2. Expose URI to this images (blob URI) . 将URI公开到此图像(blob URI)。 I wonder if it is safe way to do it . 我不知道这样做是否安全。

I'm not sure of your criteria, but for giving out access to a particular blob you may want to take a look at shared access signatures . 我不确定您的标准,但是要给出对特定Blob的访问权限,您可能需要查看共享访问签名 The service would then create a SAS token for the client and return that with the image URI. 然后,该服务将为客户端创建SAS令牌,并将其与图像URI一起返回。 The client could access the photo using the SAS for authentication. 客户端可以使用SAS访问照片以进行身份​​验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM