【发布时间】:2019-10-15 15:13:33
【问题描述】:
尝试开发一个 Xamarin Forms 移动应用程序,该应用程序通过 api 显示存储在 Azure-Storage 容器中的 blob。
当前流程是这样的 API > Azure-Storage Blob > 在 Xamarin 移动应用程序中显示。
使用存储帐户密钥连接到 Azure 存储。
问题是,当容器上的公共访问设置设置为“私有”时,Blob 不会显示在移动应用程序中。 如果容器公共访问设置设置为“blob”,则照片将显示在 xamarin 移动应用中。
照片用于说明目的。Photo of issue
代码如下。
string storageConnectionString
Environment.GetEnvironmentVariable("storageconnectionstring");
CloudStorageAccount storageAccount;
if (CloudStorageAccount.TryParse(storageConnectionString, out
storageAccount))
{
// If the connection string is valid, proceed with operations against
Blob storage here.
...
}
else
{
//Error
}
[enter image description here][1]CloudBlobClient cloudBlobClient = storageAccount.CreateCloudBlobClient();
如何在移动应用程序中显示 blob 的同时将容器设为私有?
【问题讨论】:
-
您似乎遗漏了很多有关如何访问 blob 数据和显示图像的相关代码。如果我们看不到您在做什么,我们就无法告诉您出了什么问题
标签: c# azure xamarin.forms azure-blob-storage azure-web-app-service