HttpResponseMessage重定向到私有Azure Blob存储

时间:2017-02-10 15:15:26

标签: c# asp.net azure azure-storage-blobs

使用asp.net开发API

是否可以将用户重定向到私有azure blob存储?我可以使用SAS密钥或azure blob SDK吗?

例如,我想做这样的事情:

var response = Request.CreateResponse(HttpStatusCode.Moved);
response.Headers.Location = new Uri(bloburl);
return response;

是否可以通过在URL中放置密钥来访问私有blob?显然我不想把主密钥放在那里。

1 个答案:

答案 0 :(得分:1)

  

是否可以将用户重定向到私有azure blob存储?能够   我使用SAS密钥或azure blob SDK吗?

是的,完全可以将用户重定向到私有blob。您需要创建一个至少具有ElementKind.TYPE_USE权限的Shared Access Signature (SAS),并将该SAS令牌附加到您的blob网址并重定向到该网址。

您的代码看起来像这样:

Read